Update from Sync Service

This commit is contained in:
FNS Service
2026-04-21 17:41:25 +08:00
parent f282f6363f
commit 65f16fe48c
245 changed files with 5459 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
use master
go
```sql
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_killspid]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_killspid]
GO
create proc p_killspid
```
@dbname varchar(200) --要关闭进程的数据库名
as
```sql
declare @sql nvarchar(500)
declare @spid nvarchar(20)
declare #tb cursor for
select spid=cast(spid as varchar(20)) from master..sysprocesses where dbid=db_id(@dbname)
open #tb
fetch next from #tb into @spid
while @@fetch_status=0
```
begin
exec('kill '+@spid)
```sql
fetch next from #tb into @spid
```
end
close #tb
deallocate #tb
go
--用法
```sql
exec p_killspid 'safeMonitorMgr'
go
```
DBCC SHRINKDATABASE (safeMonitorMgr)
go
```sql
drop proc p_killspid
```