上一页 1 ··· 5 6 7 8 9 10 下一页
  2007年11月9日
摘要: ---生成测试表Tif exists(select 1 from sysobjects where Name=N'T' and objectProperty(ID,N'IsUserTable')=1) drop table Tgoselect top 5 ID,Name into T fr... 阅读全文
posted @ 2007-11-09 00:24 中國風 阅读(185) 评论(0) 推荐(0) 编辑
  2007年8月25日
摘要: use master go declare @detach nvarchar(4000) set @detach='' select @detach=@detach+char(13)+'exec sp_detach_db '+quotename(Name)+',''true''' fro... 阅读全文
posted @ 2007-08-25 11:49 中國風 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 作业的操作企业管理器 --管理 --SQL Server代理 --右键作业 --新建作业 --"常规"项中输入作业名称 --"步骤"项 --新建 --"步骤名"中输入步骤名 --"类型"中选择"Transact-SQL 脚本(TSQL)" --如:下面的SQL腳本--"数据库"选择执行命令的数据... 阅读全文
posted @ 2007-08-25 11:42 中國風 阅读(138) 评论(0) 推荐(0) 编辑
  2007年2月13日
摘要: 2005的行列转换: create table ta(编号 int,人员 varchar(5), 年份 int,月份 int ,[1号] varchar(5), [2号] varchar(5),[3号] varchar(5),[4号] varchar(5))insert ta select 1, ... 阅读全文
posted @ 2007-02-13 17:01 中國風 阅读(112) 评论(0) 推荐(0) 编辑
摘要: if object_id('Tempdb..#Roy') is not null drop table #Roy create table #Roy (a int,b varchar(10),c int,d int) insert #Roy select 1, '小李', 1, 2... 阅读全文
posted @ 2007-02-13 16:21 中國風 阅读(106) 评论(0) 推荐(0) 编辑
  2007年1月7日
摘要: 如何区分大小写、全角半角(SQL2000测试通过):/*用定义排序规则(Chinese_PRC_CS_AS_WS、Chinese_PRC_BIN)来区分,介绍两种排序规则:第一个Chinese_PRC所属区域(中文(香港特别行政区),中文(中华人民共和国),中文(新加坡))CS(CaseSensi... 阅读全文
posted @ 2007-01-07 09:10 中國風 阅读(376) 评论(0) 推荐(0) 编辑
  2007年1月4日
摘要: create table ta(id int, name varchar(50))insert taselect 1, 'aa,bb'union all select 2, 'aaa,bbb,ccc'union all select 3, ... 阅读全文
posted @ 2007-01-04 13:10 中國風 阅读(86) 评论(0) 推荐(0) 编辑
  2007年1月3日
摘要: 用存储过程处理插入值重复时(如果插入id值存在时,在存在id值增1后再插入)create table ta(id int primary key,name varchar(20))insert taselect 1,'a'union all select 2,'b'union all select... 阅读全文
posted @ 2007-01-03 09:45 中國風 阅读(124) 评论(0) 推荐(0) 编辑
  2006年12月24日
摘要: create table ta(number int) create trigger test_tr on tafor insertasbeginDECLARE @number int,@sql varchar(4000),@sql1 varchar(4000),@i intDECLARE roy... 阅读全文
posted @ 2006-12-24 18:22 中國風 阅读(120) 评论(0) 推荐(0) 编辑
摘要: --測試 create table ta ( 项目 varchar ( 20), 上级项目 varchar ( 20), num int ) insert ta select 'A' , '' , 100 union all select 'B' , '... 阅读全文
posted @ 2006-12-24 18:21 中國風 阅读(136) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页