Viewing 15 posts - 1 through 15 (of 7,626 total)
You're welcome! Very glad it helped. Thanks for the nice feedback.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 11, 2026 at 3:13 am
Honestly, I think the biggest payback will be from page compressing the data (whether you use separate filegroups or not).
As always, it's vital to have the best clustered index on...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 11, 2026 at 3:06 am
For example,
SELECT t1...., ca1....
FROM dbo.table1 t1
CROSS APPLY (
SELECT TOP (1) ...
FROM dbo.table2 t2
WHERE t2.column LIKE...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 8, 2026 at 7:32 pm
Yes. Use a CROSS APPLY or OUTER APPLY (rather than a JOIN) with a TOP (1) ORDER BY LEN(<matched_column>) DESC
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 8, 2026 at 7:30 pm
b) there could be an issue if the flag in the Task table doesn't match the data in the vendors table. In other words, if the task is marked complete,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 2, 2026 at 8:02 pm
Option 1 has performance issues.
Not necessarily.
Qs:
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
October 2, 2026 at 3:24 pm
Dynamically create a view that references all the applicable tables at the moment your code started running.
For example, roughly like this. [Edits in italics] You didn't give any real details...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
September 22, 2026 at 2:53 pm
To make it (much) less fragile, I would likely automate the creation of the Alerts by using a proc, via sp_add_alert.
The proc would take in the % size as a...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 25, 2026 at 2:28 pm
You can create a standard SQL alert that is based on the db size (in KB) exceeding whatever amount you specify.
In SQL Server Agent; "Alerts"; "New Alert"; "SQL Server performance...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 23, 2026 at 9:46 pm
Interesting q. No, haven't done that.
I guess easiest would be to use a subquery, which you're already familiar with, so that's not what you're looking for, but just to be...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 19, 2026 at 3:33 pm
Definitely use new VMs. Too many installation settings could matter here. The new VM approach also allows you to test with a db to two without having to wait for...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 19, 2026 at 2:08 pm
No, I don't think you would. I don't think TEXTIMAGE_ON clause is allowed is a partition scheme is used (based on MS documentation). Sorry, I don't have time to test...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 12, 2026 at 2:46 pm
Don't need IIF, just standard WHERE NOT:
WHERE NOT (Customer between 99202 and 99215 and State = 'NY')
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
July 14, 2026 at 7:30 pm
Sounds like you could use a SEQUENCE. For example:
CREATE SEQUENCE dbo.bom_sequence AS int START WITH 9000000 INCREMENT BY 1 NO CYCLE ;
SELECT CASE WHEN item_number = ''...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 17, 2026 at 6:46 pm
A leading datetime clustering key would not be a problem at all, i.e., there's no reason to exclude a datetime from a clustering key. As you, and others, have noted,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
May 21, 2026 at 4:21 pm
Viewing 15 posts - 1 through 15 (of 7,626 total)