摘要: create proc dtLink(@dbName varchar(50) --数据库名称)as--查询临时表是否存在if(OBJECT_ID('temp..db') is not null)begin drop table #TempTableend--创建临时表create table ... 阅读全文
posted @ 2014-11-14 13:34 我要找到我的全世界 阅读(261) 评论(0) 推荐(0)
摘要: --日期参数,此处可以建立存储过程,接收月份,计算月开始结束时间或者直接接受开始与结束时间declare @begDate datetime = '2014-06-01'declare @endDate datetime = '2014-06-30'declare @text varchar(max... 阅读全文
posted @ 2014-11-14 13:32 我要找到我的全世界 阅读(1250) 评论(0) 推荐(0)
摘要: --建立函数计算星期create function w_count(@ym varchar(6) --月份,@dw varchar(8))--星期几returns intas begindeclare @count_day int = 0declare @b datetime = cast(@ym... 阅读全文
posted @ 2014-11-14 13:30 我要找到我的全世界 阅读(557) 评论(2) 推荐(0)
摘要: --声明变量DECLARE @X INTSELECT @X=1--标记GOTO跳转位置TEST:PRINT @XSELECT @X=@X+1--WHILE @X<=3 --GOTO跳转到执行位置IF @X<=3 GOTO TEST 阅读全文
posted @ 2014-11-14 13:29 我要找到我的全世界 阅读(692) 评论(0) 推荐(0)
摘要: declare @a int = ASCII('A')declare @b int = ASCII('F')declare @c int = 1while(@a @b) begin if(@c = 1) begin set @a = ASCII('a') set @b = ASCII(... 阅读全文
posted @ 2014-11-14 13:28 我要找到我的全世界 阅读(1441) 评论(0) 推荐(0)