- Use Master
- Go
- Declare @dbname sysname
- Set @dbname = 'DBNAME'
- Declare @spid int Select @spid = min(spid) from master.dbo.sysprocesses
- where dbid = db_id(@dbname)
- While @spid Is Not Null Begin
- Execute ('Kill ' + @spid)
- Select @spid = min(spid) from master.dbo.sysprocesses
- where dbid = db_id(@dbname) and spid > @spid
- End
Compare Sql Server Table Constraints
13 years ago
0 comments:
Post a Comment