Help with OUTPUT INSERTED syntax needed - I want to collect a value from the source table of a SELECT statement used in an INSERT statement, that...
HOW TO USE EXISTS FUNCTION WITH 3 TABLES - Can you Please show me that how can we use EXISTS FUNCTION WITH 3 OR MORE TABLE. Please show me...
Retaining values between date range - Good afternoon I need to calculate rolling 12 month count I.e. 1/1/2018 - 12/31/2018 is period 1 , 2/1/2018 - 1/30/2019 is period...
TSQL Help with a Stored Procedure. - I need help with my below mentioned Stored Procedure - specific to the field in my dataset. Per my clients specifications,...
Deadlock troubleshooting - My boss is asking me about how I would end up resolving this issue that is causing deadlocks and most...
Find New SQL Servers - I am trying to find all new SQL Servers and DBs being created and grant appropriate access.Very often we learn...
High Availabiltiy Role Change Alerting - I've created a SQL Alert to email an operator when the High Availability Group fails over. I've set it to...
How does a cursor affect the optimizer (and the execution plan) ? - Hi, This is Part 2 of Slow in the Application, Fast in SSMS. How to force the execution plan generated by...
Query runs slow when executing under the context of a different DB - I am trying to understand this behavior but when I try to use the below code and execute it in...
Slow in the Application, Fast in SSMS. How to force the execution plan generated by SMSS - Hi, This is my second case this week where the same query is fast in SSMS and slow in the application....
datetime - with 01/01/1000 date - Am I on the right track here when a vendor sends me data that includes a "begin date" of 01/01/1000...
sent SQL query as formatted Excel .xlsx via email - I already have a working stored procedure that exports sql query data set into a .csv file and emails it. Works great. Now I...
Can I set TDE Encryption off while my db actively in use? - We have a DB about 45GB (32gb compressed-backed up) that has TDE setup, I need to remove encryption so I...
Turn on Scalar Permissions - We have a production database and also a reporting database, that is essentially just a copy of the original DB....
How does the target table size impact the insert performance - I have a target table which is incrementing with 2 Million records every day from the past 30 days. Earlier...
Parse string based on a list of values - Rather that use a bunch of replace functions, is there a better way to parse these values, CH,HC,MA,NH,OA,OTH,PSY,SNF, out of...
Save the actual execution plan of a SQL statement in a script - I have a script that runs in SSIS from an "Execute SQL Task". One statement that is taking about 1...
nvarchar to smalldatetime - Im currently working on updating company database in which on one of the tables the 'CreateDt' is in the nvarchar...
Query to group and count data elements from a single column - In records 1, 2 and 3 (plus 3000 more rows), we have the following sample data from table SAMPLE_DATA, COL01: The...
Export memo field to Excel truncates values - I am using MS Access 2007. There are two tables each having a memo column. I have written a IIF statement to...