Viewing 15 posts - 601 through 615 (of 7,613 total)
Part of the QotD is knowing defaults. This was left off, as many people do this and the default is to allow NULLs.
As a good practice, however, I...
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 25, 2022 at 10:19 pm
(1) Not guaranteed, but you could try looking at sys.dm_exec_input_buffer.event_info (SQL 2016+ only, I think). I would issue this command immediately upon entering the trigger, to have the best chance...
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 25, 2022 at 10:11 pm
It may fragment some indexes and not others. You certainly don't want to automatically rebuild every index. Also, rebuild from smallest to largest of the indexes that do need rebuilt.
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 21, 2022 at 5:53 pm
Liked Rune's comment.
And that is why you should always explicitly specify NOT / NOT NULL when creating a table. From the context of the q, I could work out that...
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 21, 2022 at 4:31 pm
Shrink only the file(s) that are part of the PRIMARY filegroup:
DBCC SHRINKFILE(1, 512)
DBCC SHRINKFILE(?, 512) --if you have additional file(s) in the PRIMARY fg
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 21, 2022 at 4:27 pm
SELECT CAST(SUM(OrigWeight/2000.0) AS decimal(10,2)) Tons
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 20, 2022 at 7:02 pm
SELECT OBJECT_NAME(object_id) AS object_name
SUBSTRING(definition, CHARINDEX('##', definition) - 20, 200) AS definition_first_match,
definition
FROM sys.sql_modules
WHERE definition LIKE N'%##%'
ORDER BY 1
Edit: Sorry, I...
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 20, 2022 at 6:53 pm
SQL will take only those locks needed to guarantee consistency and accuracy in results. As Jeff said, the details of that depend, but that is the general approach.
Is A an...
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 20, 2022 at 6:29 pm
Do you -- the user running the code -- also have sysadmin permission? If you have sysadmin permission, any DENYs are ignored.
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 20, 2022 at 6:27 pm
Search for '##' in the text of the proc. The only real reason that string should be in there is to reference a global temp table.
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 20, 2022 at 6:26 pm
The PARTITION SCHEME tells SQL which filegroups to use for the partitions.
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 19, 2022 at 3:56 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
would you care to...
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 18, 2022 at 8:45 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
would you care to explain exactly...
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 18, 2022 at 6:20 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
Until you've had time to fully test out...
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 18, 2022 at 2:18 pm
Are you sure you matched the original data type and length? For example, if the original columns was varchar(8000) and you specified varchar(4000), obviously data might get truncated.
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 14, 2022 at 8:02 pm
Viewing 15 posts - 601 through 615 (of 7,613 total)