Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
-- Get a cursor with the processes that have to die in order to be able to drop db
DECLARE curProcesses CURSOR
LOCAL
FAST_FORWARD
READ_ONLY
FOR
SELECT spid
FROM
Master..sysprocesses
WHERE
dbid = @nDR_ID
OPEN curProcesses
FETCH NEXT FROM curProcesses INTO --Gets the first process
@nKillProcess
SET @nFetchStatus = @@FETCH_STATUS
--Kill the processes
WHILE @nFetchStatus = 0
BEGIN
SET @sTemp ='KILL ' + CAST(@nKillProcess as varchar(5))
EXEC(@sTemp)
FETCH NEXT FROM curProcesses INTO --Gets the next process
@nKillProcess
SET @nFetchStatus = @@FETCH_STATUS
END
CLOSE curProcesses
DEALLOCATE curProcesses