[tarantino] r168 committed - - Upgraded database connection dropping T-SQL

1 view
Skip to first unread message

codesite...@google.com

unread,
Apr 22, 2011, 12:48:59 PM4/22/11
to tarantino...@googlegroups.com
Revision: 168
Author: kwhurwitz
Date: Fri Apr 22 09:47:43 2011
Log: - Upgraded database connection dropping T-SQL
http://code.google.com/p/tarantino/source/detail?r=168

Modified:

/trunk/src/Tarantino.DatabaseManager.Core/DatabaseManager/SqlFiles/DropConnections.sql

=======================================
---
/trunk/src/Tarantino.DatabaseManager.Core/DatabaseManager/SqlFiles/DropConnections.sql
Thu Aug 20 13:05:42 2009
+++
/trunk/src/Tarantino.DatabaseManager.Core/DatabaseManager/SqlFiles/DropConnections.sql
Fri Apr 22 09:47:43 2011
@@ -11,11 +11,15 @@
TRUNCATE TABLE #LIVE_SPIDS

INSERT INTO #LIVE_SPIDS
-SELECT
- spid
-FROM Master.dbo.SYSPROCESSES
-WHERE dbid IN (SELECT dbid FROM Master.dbo.SYSDATABASES WHERE name = '||
DatabaseName||')
- AND spid <> @@SPID AND spid > 50
+SELECT distinct
+ spid
+FROM
+ Master.dbo.SYSPROCESSES sp
+ inner join sys.dm_exec_sessions es on es.host_process_id =
sp.hostprocess
+WHERE
+ dbid IN (SELECT dbid FROM Master.dbo.SYSDATABASES WHERE name = 'ETT')
+AND spid <> @@SPID
+AND es.is_user_process = 1

SET @x = (SELECT MIN(nid) FROM #LIVE_SPIDS)

Reply all
Reply to author
Forward
0 new messages