Viewing 15 posts - 601 through 615 (of 7,616 total)
I've never heard of anything like that in SQL Server.
October 25, 2022 at 10:23 pm
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...
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...
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.
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...
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
October 21, 2022 at 4:27 pm
SELECT CAST(SUM(OrigWeight/2000.0) AS decimal(10,2)) Tons
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...
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...
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.
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.
October 20, 2022 at 6:26 pm
The PARTITION SCHEME tells SQL which filegroups to use for the partitions.
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...
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...
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...
October 18, 2022 at 2:18 pm
Viewing 15 posts - 601 through 615 (of 7,616 total)