November 27, 2006 at 3:29 pm
Allow feedback on the "Script of the Day".
In particular, the one for 11/23 -- "Kill Connections to Specific Database" -- is a poor method of doing that function.
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".
November 28, 2006 at 9:07 am
Kill connections is pretty good.
but if you think 'kill connections' is bad...
check out the 'database growth details" the code for today, 28-nov-2006. it is "Spaghetti-that-the-baby-threw-up" code.
sorry to the coder of DGD.
November 28, 2006 at 9:20 am
It's on the list. We'll get it done.
November 28, 2006 at 9:27 am
> Kill connections is pretty good. <
No, it's not - ALTER DATABASE should be used.
And if you really want to issue specific KILLs, you can do it something like this:
DECLARE @sql VARCHAR(8000)
SET @sql = ''
SELECT @sql = @sql + 'KILL ' + CAST(spid AS VARCHAR(10)) + ' '
FROM sysprocesses WITH (NOLOCK)
WHERE spid > 50 AND DB_NAME(dbid) = N'databaseName'
EXEC(@sql)
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".
November 28, 2006 at 9:48 am
IN COMPARISON TO TODAY's SCRIPT.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply