[代码实例][SQLServer]关闭连接
程序员文章站
2022-03-02 22:13:44
[代码实例][sqlserver]关闭连接。
if exists
(
select *
from master.sys.databases
wh...
[代码实例][sqlserver]关闭连接。
if exists ( select * from master.sys.databases where name='educationdb' ) begin declare @spid varchar(20) declare curdblogin cursor for select cast(spid as varchar(20)) as spid from master.sys.sysprocesses where dbid=db_id('educationdb'); open curdblogin; fetch next from curdblogin into @spid; while @@fetch_status=0 begin if @spid!=@@spid exec('kill ' + @spid) fetch next from curdblogin into @spid end close curdblogin; deallocate curdblogin; drop database educationdb; end go
上一篇: css怎样设置table边框宽度