Viewing 15 posts - 2,416 through 2,430 (of 7,608 total)
I prefer this method:
declare
@start_dt datetime='2019-12-02',
@end_dt ...
April 1, 2020 at 4:05 pm
You need to be aware that "Execution plan Query cost relative to the batch" is meaningless. SQL is very often quite wrong on this number. Just ignore it!
You need to...
March 26, 2020 at 8:50 pm
Great. I guess that confirms it gave you the results you needed :-).
March 26, 2020 at 5:45 pm
LEFT OUTER JOIN (
SELECT *, ROW_NUMBER() OVER(PARTITION BY customer, ApplicationName ORDER BY Created DESC) AS row_num FROM [CIS].[dbo].[patches]
) AS patches ON patches.customer = a.number and patches.ApplicationName = custapps.app AND patches.row_num...
March 26, 2020 at 5:10 pm
SELECT ...same_as_before_except_add_patches_columns...
FROM customers
LEFT OUTER JOIN (
SELECT *, ROW_NUMBER() OVER(PARTITION BY customer ORDER BY Created DESC) AS row_num
FROM [CIS].[dbo].[patches]
) AS...
March 26, 2020 at 4:47 pm
What I usually do in those situations, if the file's not way too extremely large (2GB max file size; for any size up to 1.5GB, I've found that it takes...
March 24, 2020 at 9:27 pm
I think this will give you what you need. I went down to the minute to allow bookings like '10:10' to '10:45'. You may not have that now, but it...
March 23, 2020 at 5:32 pm
You're right, you can't avoid dynamic SQL here. You need dynamic SQL here to insure you get the best query plan.
March 20, 2020 at 2:36 pm
Steve and Jeff, thank you. Good to have other eyes on this. 🙂 What should I do with the earlier incorrect code? Wipe it out? Should I have kept...
March 19, 2020 at 8:50 pm
I'd stick with something more SQL-ish, and also more readily readable and understandable, like below. If you're converting Access to SQL Server, it's convenient to use IIF, otherwise avoid it. ...
March 19, 2020 at 8:06 pm
'''' + p.firstname + ''',''' +
p.lastname + ''',''' +
i.city + ''',''' +
t.stateAbbrveation + ''',''' +
Convert(char(5), c.peopleId) + ''''
as insert_string
March 19, 2020 at 5:00 pm
Every SQL database restore must start with a full backup restore.
After that, you can, if you want to, restore a differential backup (that was taken after the full backup you...
March 17, 2020 at 7:44 pm
Use this to generate the SELECT statements to review. After you've verified the statements, run them if / as you see fit.
DECLARE @DTCHANGEDON_found bit
DECLARE @DTCREATEDON_found bit
DECLARE @end_date...
March 17, 2020 at 7:24 pm
You really should start using the new syntax, with parentheses around the row count:
SELECT TOP (2) *
FROM STRING_SPLIT(@s, ',') AS ss
March 17, 2020 at 2:42 pm
Viewing 15 posts - 2,416 through 2,430 (of 7,608 total)