print 'Killing active connections to the "' + 'OCMS_DEV' + '" database'
declare @execSql varchar(400)
-- Create the sql to kill the active database connections
set @execSql = ''
select @execSql = @execSql + 'kill ' + convert(char(10), spid) + ' '
from master.dbo.sysprocesses
where db_name(dbid) = 'OCMS_DEV'
and
DBID <> 0
and
spid <> @@spid
exec (@execSql)