Viewing 15 posts - 1 through 15 (of 1,417 total)
The below query will produce your desired result:
select *
from #OutputTable
where coalesce(SeasonalAddressID, -1) = case
when (@SeasonalAddressFlag = 1)
then SeasonalAddressID
else coalesce(SeasonalAddressID, -1)
end
December 9, 2020 at 12:11 pm
Try to execute this query with BCP instead of querying the sys.syscomments table:
SELECT OBJECT_DEFINITION(object_id) FROM sys.objects WHERE type = 'P' AND name = 'sp_ic9av0_dx_length'
July 21, 2020 at 10:20 am
There is a huge difference between image back-up and a database back-up. It's a long story to explain everything of a database back-up, so I suggest you first read articles/blogs...
July 21, 2020 at 9:59 am
You can use the script to run on each instance. It will show the last back-up (full, diff, log) taken of each database. You can use sp_send_dbmail to send the...
July 2, 2019 at 2:27 pm
Sounds like an implicit conversion somewhere along the way. Do you alter the contents of that field between the SELECT and the INSERT?
For debugging purpose: store the final result into...
June 25, 2019 at 12:24 pm
Agree with Grant, but also check (just to be sure) that the query isn't blocked! Query the sys.dm_exec_requests DMV and check the "blocking_sessions_id" column (should be 0).
select...
June 25, 2019 at 12:14 pm
Here's a script to display all indexes including the defined columns within the current database. You can easily adjust the script to filter on the required table(s) and to generate...
June 25, 2019 at 9:23 am
Get the query that is behind each dataset from each report. See if these queries run slow when executing directly from Management Studio (using the same parameter values as when...
June 25, 2019 at 9:11 am
Is the linked server itself correct defined? Test this from SQL with stored procedure
exec sp_testlinkedserver 'ExcelLinkSrv2';
June 25, 2019 at 8:53 am
I'm sorry. I don't understand what you are trying to accomplish. Can you provide some sample data (DDL and DML), the sample code of your stored procedure(s) and a display...
June 25, 2019 at 8:33 am
No need to run it multiple times. You can join it with a table that holds the months (or use some sort of a calendar table and extract the monthnumber...
May 1, 2019 at 2:22 pm
Perhaps this code will get you started. It will extract the current month and calculate the last day of the previous month. In a CASE statement it will determine if...
May 1, 2019 at 7:21 am
Viewing 15 posts - 1 through 15 (of 1,417 total)