最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
修改mssql数据库字符集sql
时间:2022-06-29 08:01:17 编辑:袖梨 来源:一聚教程网
| 代码如下 | 复制代码 |
use master 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 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) fetch next from #tb into @spid end close #tb deallocate #tb go --关闭对数据库newhis 的连接 exec p_killspid 'database_temp' --更改排序规则 alter database database_temp COLLATE Chinese_PRC_CI_AS --结束后删除存储过程 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] |
|
相关文章
- investopedia官网中文版入口-investopedia国内能用的官方网页版入口地址 07-09
- 一点文学txt小说网站入口-一点文学小说官网入口地址2026最新 07-09
- 易校园怎么绑定微信 07-09
- 七彩课堂ppt课件入口-七彩课堂ppt课件下载官方网页版入口地址 07-09
- 漫蛙漫画官方免费漫画在哪看 07-09
- 反思日记app如何缩小文字比例 07-09