logo
down
shadow

SQL-SERVER QUESTIONS

How to check df rows that has a difference between 2 columns and then send it to another table to verify information
How to check df rows that has a difference between 2 columns and then send it to another table to verify information
this one helps. One solution could be to make a new column where you store the result of the diff between df[1] and df[2]. One note first. It might be more precise to either name your columns when you make the df, then reference them with df['name1']
TAG : sql-server
Date : December 02 2020, 10:46 PM , By : user3045631
All rows from Table in Database B and C, only unique rows from Table in Database A
All rows from Table in Database B and C, only unique rows from Table in Database A
I think the issue was by ths following , I've got a requirement to select data from a table which exists in several databases which hinges on excluding duplicates in a specific way. The data is such that rows in databases B and C might contain the sa
TAG : sql-server
Date : December 01 2020, 04:52 PM , By : user3045227
Questions around AlwaysOn replication on SQL Server 2016 SP1
Questions around AlwaysOn replication on SQL Server 2016 SP1
Hope that helps If these all do replicate, is there anything which doesn't replicate over using an AlwaysOn?
TAG : sql-server
Date : December 01 2020, 04:52 PM , By : user3045041
Generate Scripts, Works for Views?
Generate Scripts, Works for Views?
I wish this help you It doesn't work that way unfortunately, due to the nature of what a view is. Views don't typically persist/contain "data", rather they are a query to access data, and inserting into a view is sketchy at best and flat out doesn't
TAG : sql-server
Date : December 01 2020, 04:50 PM , By : user3044998
Fill date gaps and Interpolate values
Fill date gaps and Interpolate values
will help you I have a very simple table with a date (in days), equipment name and engine hours (cumulative) for that day in a SQL Server table. The raw data table shows there are gaps in the day dates. I need to fill the gaps and interpolate to prov
TAG : sql-server
Date : December 01 2020, 04:50 PM , By : user3044842
SQL Server Stock age calculation - Alternative to nested cursors
SQL Server Stock age calculation - Alternative to nested cursors
it fixes the issue You can get the desired output by using Sum() over(order by). This function returns running total of the column in SQL. So the query will be:
TAG : sql-server
Date : December 01 2020, 04:47 PM , By : user3044424
T-SQL crazy function result
T-SQL crazy function result
hope this fix your issue The constraint you added to the table actually means that you can't insert any name in the table, because for any value inserted in the table the function should return 1.This is impossible because if the name was inserted th
TAG : sql-server
Date : December 01 2020, 04:47 PM , By : user3044415
Missing Migration data in SQL when trying to add-migration
Missing Migration data in SQL when trying to add-migration
To fix the issue you can do So I found something that did help! It unfortunately meant that I lost all of my migration files, but thats not the end of the world.The below is reference from this site: Click here
TAG : sql-server
Date : December 01 2020, 04:42 PM , By : user3044231
Unable to convert from base64 to any meaningful thing
Unable to convert from base64 to any meaningful thing
it should still fix some issue That isn't Base64, it's just a hexadecimal notated number. You can convert it to varbinary and from there to varchar.
TAG : sql-server
Date : December 01 2020, 04:42 PM , By : user3043722
Begin Try End Try Begin Catch update table end Catch
Begin Try End Try Begin Catch update table end Catch
around this issue I found my mistake.In the below script (cut out from the question):
TAG : sql-server
Date : December 01 2020, 04:40 PM , By : user3043499
Microsoft SQL Case statement not working in Order By statement
Microsoft SQL Case statement not working in Order By statement
Hope that helps I have a database column which is used as a grouping for variations for products and it is not in the First Normal Form. We don't need the Width, Height and the measurements to be in separate columns. , Explanations:Consider the follo
TAG : sql-server
Date : December 01 2020, 04:36 PM , By : user3043128
SQL Server connection with Docker and Entity Framework
SQL Server connection with Docker and Entity Framework
around this issue For sharing network between two containers, we could use docker-compose which will create the shared network.Follow steps below:
TAG : sql-server
Date : November 29 2020, 12:01 PM , By : user3042773
Group by 24hr Period starting at 7:00 AM
Group by 24hr Period starting at 7:00 AM
Does that help I am going to presume your time is probably in UTC. I would look at converting the time to the timezone you need. Then it gives you more options of how you want to deal with the data, also you could customize the report for people in d
TAG : sql-server
Date : November 28 2020, 12:01 PM , By : Victor Gershgorn
Make Azure SQL database offline in a failover group
Make Azure SQL database offline in a failover group
To fix this issue You can use a forced failover which may result in data loss same as a server down or datacenter down scenario. Note that is not the same as a manual or friendly failover using the portal, on which case there is no danger of data los
TAG : sql-server
Date : November 27 2020, 05:23 PM , By : Justin
How to perform complex join on three tables
How to perform complex join on three tables
help you fix your problem This should do it. If CategoryNAME coming back as null, then you're doing a LEFT OUTER join and have referential integrity issues.
TAG : sql-server
Date : November 26 2020, 03:04 PM , By : user3041682
How to hide duplicate rows and display 4 count texts in 4 columns
How to hide duplicate rows and display 4 count texts in 4 columns
With these it helps There is missing where part in every select count(*)... .... ,(select count(*) from Work w2 where status like 'Enable' and w.row = w2.row and w.type = w2.type ) as 'Enable' ...
TAG : sql-server
Date : November 26 2020, 03:04 PM , By : user3041583
Increment dates by one month for the rows using partition by in SQL Server
Increment dates by one month for the rows using partition by in SQL Server
wish of those help Try this following script.You can check the DEMO HERE
TAG : sql-server
Date : November 26 2020, 12:01 PM , By : gdevise
SQL Server 2016 Database Mail will not connect to mail server
SQL Server 2016 Database Mail will not connect to mail server
wish help you to fix your issue You state: this server is hosted in the cloud... where in the cloud: AWS, Azure? If AWS, is it an RDS or EC2? Sounds to me like the message is being blocked possibly the outgoing port by the cloud provider. For instanc
TAG : sql-server
Date : November 26 2020, 12:01 PM , By : user3041114
Generating Sub Reports for Each Cashier and Grand Total For each day
Generating Sub Reports for Each Cashier and Grand Total For each day
Hope this helps You can achieve the results desired by using the appropriate grouping levels and summary fields as well.The top most grouping level would be "Order Date". And then below that you would group by "Cashier".
TAG : sql-server
Date : November 26 2020, 06:23 AM , By : SkyRiver
How can I insert decimals into a number
How can I insert decimals into a number
around this issue I have a DB file that is exported from Oracle. I'm using SQLite command line to convert a table in the DB file to a CSV so I can then import the data into MSSQL. My problem is that the table I need has numbers for one field formatte
TAG : sql-server
Date : November 26 2020, 06:23 AM , By : user3040593
SQL Server output as XML all on one line
SQL Server output as XML all on one line
around this issue If you just want to see it on Notepad++, use plugin XML Tools to "pretty print" the XML into an easier to read format.
TAG : sql-server
Date : November 26 2020, 06:23 AM , By : user3040524
Run-time error in VBA when SQL table doesn't exist
Run-time error in VBA when SQL table doesn't exist
should help you out It's not the database or its tables; method Refresh of QueryTable would have failed if that were the case.It fails well before that; a call to method Range of (hidden) object _Global happens when you implicitly reference the Activ
TAG : sql-server
Date : November 26 2020, 06:23 AM , By : user3040407
Get results from past year if 1st of january
Get results from past year if 1st of january
This might help you Can you please check this simple adjustment in WHERE condition works for you or not. This will only return records for the Maximum YEAR available in the table.
TAG : sql-server
Date : November 26 2020, 06:18 AM , By : user3040311
How to automatically push data from Excel file to SQL Server?
How to automatically push data from Excel file to SQL Server?
Any of those help I will look forward to two options in this scenario: SSIS Package: Use SSIS package which picks up data from a specified path (your excel), which inserts new rows and updates existing ones. Schedule this package with SQL Job agent.
TAG : sql-server
Date : November 26 2020, 06:18 AM , By : user3040265
Row order in "magic" tables inserted deleted
Row order in "magic" tables inserted deleted
This might help you question is whether rows in deleted and inserted tables (on update) are always in the same order? No, the INSERTED and DELETED virtual tables are not guaranteed to be in the same order.
TAG : sql-server
Date : November 25 2020, 12:01 PM , By : user3039967
SQL Server 2017 -Database Restore, Overwrite without REPLACE
SQL Server 2017 -Database Restore, Overwrite without REPLACE
this will help The REPLACE option overrides several important safety checks that restore normally performs.
TAG : sql-server
Date : November 25 2020, 12:01 PM , By : user3039916
Unable to get ODBC Driver 17 for SQL Server on Raspbian 10 (Buster)
Unable to get ODBC Driver 17 for SQL Server on Raspbian 10 (Buster)
hop of those help? I managed to resolved the issue by modifying odbc.ini and odbcinst.in on /etc. I was able to connect to the database after modifying those files. I think that the ODBC 17 comes blank and that's the issue. odbc.ini
TAG : sql-server
Date : November 25 2020, 12:01 PM , By : user3038834
SQL Server SSIS Export as XML Error: Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position
SQL Server SSIS Export as XML Error: Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position
it fixes the issue You re-posted this question on the Microsoft forum where I found it originally. I already answered it there. https://social.msdn.microsoft.com/Forums/en-US/f85ebd77-e7cb-4073-81e7-77a2ed5ab425/sql-server-ssis-export-as-xml-error-na
TAG : sql-server
Date : November 25 2020, 12:01 PM , By : user3038803
Restrict duplicate records to insert into table at same time
Restrict duplicate records to insert into table at same time
To fix this issue How to restrict duplicate data to insert into table without using primary key and unique constraints? , You may try adding a unique constraint to the dat column:
TAG : sql-server
Date : November 24 2020, 12:01 PM , By : user3038461
Date function for following month
Date function for following month
hope this fix your issue What function can I use to get the date for the following month, in the format 201907? , You can use DATEADD:
TAG : sql-server
Date : November 24 2020, 05:49 AM , By : zoglmannk
Avoid repeating a function in stored procedure?
Avoid repeating a function in stored procedure?
I wish this help you Use a CTE or subquery to compute it once and reference the resulting column as a WHERE filter and as a SELECT result column:
TAG : sql-server
Date : November 24 2020, 05:48 AM , By : user3038046
Updating a Table through a stored procedure with variable parameters
Updating a Table through a stored procedure with variable parameters
will help you You can use COALESCE() function to build this kind of update statement
TAG : sql-server
Date : November 23 2020, 12:01 PM , By : Jason Lian
SQL Server 2008 SSIS Export Wizard - find out how long it took
SQL Server 2008 SSIS Export Wizard - find out how long it took
will be helpful for those in need We ran a SQL Server 2008 Export wizard overnight to copy 100+ tables from one server to another. The process worked fine (if a little slow over our network) , You can get an estimation by looking at the index usage s
TAG : sql-server
Date : November 23 2020, 12:01 PM , By : Olivier Giroud
SQL Server what indexes to create
SQL Server what indexes to create
I hope this helps . Create an index for UserID with Included columns BranchID, ID and DocIDSo something like
TAG : sql-server
Date : November 22 2020, 11:17 AM , By : János Tóth
Database already exists even after deleting the database files
Database already exists even after deleting the database files
may help you . The database information is maintained by sql server express. So just deleting the file doesn't remove the database from sql server. You need to detach the database and then your logic should work. Try sql server management studio expr
TAG : sql-server
Date : November 22 2020, 11:05 AM , By : Adam
SQL Server Simple Redundancy
SQL Server Simple Redundancy
hope this fix your issue Merge Replication is viable. In Merge Replication, you publish to the subscriber. Any changes made at the subscriber are made at the publisher when synchronization takes place. If the publisher goes offline, then the changes
TAG : sql-server
Date : November 22 2020, 11:02 AM , By : 杨少侠
How to get current record for each day
How to get current record for each day
Hope this helps This should work for you. It gets the distinct dates from your table, then counts the number of entries that fall on or before each date.
TAG : sql-server
Date : November 22 2020, 10:58 AM , By : David Moseley
SQL Server - Dynamic SQL View Generation (currently using cursor)
SQL Server - Dynamic SQL View Generation (currently using cursor)
fixed the issue. Will look into that further I could not test the code, but you could try something that doesn't use cursors (they are not required here)
TAG : sql-server
Date : November 22 2020, 10:58 AM , By : Dars Chung
SQL SYNONYM and performance
SQL SYNONYM and performance
will help you Here is a good SO thread on synonyms. Performance shouldn't be an issue on same server. I'm not sure cross server.https://stackoverflow.com/questions/796791/sql-server-synonyms-tips-tricks
TAG : sql-server
Date : November 21 2020, 04:03 PM , By : Jonathan Munyi
Automatically Run SSIS Package From Where Stopped after Server Connection Timeout
Automatically Run SSIS Package From Where Stopped after Server Connection Timeout
around this issue You could use Checkpoints to make your package start from where it stopped in the last run. As always, MSDN documentation is a good place to start.
TAG : sql-server
Date : November 21 2020, 07:35 AM , By : rajeshwar singh
sql query help in .Net MVC5
sql query help in .Net MVC5
wish of those help Try looking at this from the subcategory angle instead of the category.
TAG : sql-server
Date : November 20 2020, 12:01 PM , By : Shraddha Sharma
Entity Framework SaveChanges throws "Invalid object name" but its generated SQL runs just fine
Entity Framework SaveChanges throws "Invalid object name" but its generated SQL runs just fine
hop of those help? We were executing the "generated SQL" against the live database, whereas the DbContext was executing against the test database (thank you thepirat000). This occurred because we were running the DbContext from a unit test. The fix w
TAG : sql-server
Date : November 20 2020, 12:01 PM , By : N00b-Programer
How to handle label as a variable populated with sql query
How to handle label as a variable populated with sql query
To fix the issue you can do You don't have any logic that clears the label out.Just add this code to clear the label:
TAG : sql-server
Date : November 19 2020, 12:01 PM , By : Jess Kropczynski
What is the impact of creating a table in SQL Server with a unique index but no primary key?
What is the impact of creating a table in SQL Server with a unique index but no primary key?
help you fix your problem The concept of a primary key is really about relational theory; maintaining referential integrity by building relationships across multiple tables. The SQL Server engine, by default, creates a unique clustered index when a p
TAG : sql-server
Date : November 18 2020, 03:46 PM , By : j. stocker
How could i rewrite this query in sql server 2008
How could i rewrite this query in sql server 2008
seems to work fine , One way of rewriting this would be
TAG : sql-server
Date : November 18 2020, 03:42 PM , By : Aljaž Tajhman
Joining dataset in an Update statement, with specific set-conditions
Joining dataset in an Update statement, with specific set-conditions
To fix the issue you can do I hope anyone can give any input to this problem. I have two exactly the same datasets, but one is larger than the other. Basically, I want to look to see if any variables in the smaller dataset (andrat_appen) have a certa
TAG : sql-server
Date : November 18 2020, 03:42 PM , By : Mukesh Taak
How to store DT_R8 in a variable in SSIS
How to store DT_R8 in a variable in SSIS
it helps some times I was able to do this just fine. I generated a package with 2 execute sql tasks: One to POC Maverick's way and one to do what I believe you are doing.
TAG : sql-server
Date : November 18 2020, 03:42 PM , By : bogdan
MSSQL2008 Backup of Log does not reduce log size
MSSQL2008 Backup of Log does not reduce log size
I hope this helps you . SQL Server will not automatically shrink the physical size of the log after a backup. Continually shrinking and regrowing the log after each backup would cause unnecessary performance issues (growing requires zeroing out the n
TAG : sql-server
Date : November 18 2020, 12:01 PM , By : danmingyang
Duplicate parent/child data
Duplicate parent/child data
hop of those help? The problem is that INSERT doesn't really have a "from table" that you could reference in the OUTPUT clause. But you could achieve the same with MERGE statement:
TAG : sql-server
Date : November 17 2020, 12:01 PM , By : Arthur Rafayelyan
How do I save DbGeography data to SQL Server Compact using Entity Framework?
How do I save DbGeography data to SQL Server Compact using Entity Framework?
I hope this helps you . Since I need only Area property, I have just stored that data in WKT format as "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
TAG : sql-server
Date : November 17 2020, 12:01 PM , By : Âbdël Ïlâh Küdô-kûn
Get all subordinates who directly or indirectly reports to supervisor with parameter supervisor
Get all subordinates who directly or indirectly reports to supervisor with parameter supervisor
To fix the issue you can do I need to get all subordinate who direct and next direct subordinate with parameter supervisor Id.
TAG : sql-server
Date : November 17 2020, 12:00 PM , By : iomeio
is there any thing like the nested table of oracle DB in sql-server
is there any thing like the nested table of oracle DB in sql-server
this will help Sorry, the concept of nesting tables in columns does not exist in SQL server (up to 2012). You can define User-defined Table Types, but you can't use them to persists data into tables.
TAG : sql-server
Date : November 17 2020, 08:25 AM , By : feelixus
Consecutive Day Query
Consecutive Day Query
it should still fix some issue I have a table of contactIDs and datetimes, the time being when a letter was generated for the contact. Each contact can only have one letter generated a day. I want to write a query to select any contact that has had l
TAG : sql-server
Date : November 14 2020, 05:18 PM , By : Wolfgang Pfeil
SQL UDF and query optimization
SQL UDF and query optimization
wish help you to fix your issue A subquery will have better performance, but UDF can be reused much easier in other queries as well. You can use them to encapsulate specific calculations or logics at one place. If you need to change the logic you hav
TAG : sql-server
Date : November 14 2020, 05:16 PM , By : Yijun Liu
Prevent database file from copying
Prevent database file from copying
this one helps. Short answer NO!If they own that server there's little you can do.
TAG : sql-server
Date : November 14 2020, 05:16 PM , By : Optimummizey
shadow
Privacy Policy - Terms - Contact Us © festivalmusicasacra.org