
sql语句
理智Tinley
没有成果的努力,都是自我感动而已
展开
-
数据从单用户模式恢复到多用户模式
数据从单用户模式恢复到多用户模式工作中急用记录一下declare @kid varchar(8000)set @kid=''select @kid=@kid+' kill '+cast(spid as varchar(8))from master..sysprocesseswhere dbid=db_id('数据库名')Exec(@kid)alter database 数据库名 set multi_user;...原创 2021-04-14 13:32:28 · 318 阅读 · 0 评论 -
导入数据时 为避免出现重复数据的Sql语句
insert into tableName select top 1 '刘婷婷1',18where not exists (select 1 from tableName where Age = 18 and Name = '刘婷婷1'); inset into 表名 select top 1 (你要插入的数据)not exists(select 1 from 表名 where ...原创 2018-11-19 16:59:59 · 2851 阅读 · 0 评论