随笔分类 -  sqlserver

摘要:所谓Sql Server作业就是按照规定的时间执行指定的脚本,如果在SQL Server里需要定时或者每隔一段时间执行某个存储过程或3200字符以内的SQL语句时,可以用管理-SQL Server代理-作业来实现.(1)打开Sqlserver,可以再sqlserver代理中看到作业这一项(2)我们新... 阅读全文
posted @ 2015-04-20 14:47 馒头的梦想 阅读(1882) 评论(0) 推荐(1)
摘要:1:对列进行逻辑判断select ID,Score,case when Score>=90 then 'A' when Score>=80 then 'B' when Score>=70 then 'C' when Score>=60 then 'D' when Score>=50 then 'E'... 阅读全文
posted @ 2015-04-17 14:19 馒头的梦想 阅读(547) 评论(0) 推荐(1)
摘要:带有参数的视图 create function fn_fenye (@count as int,@page as int) returns table as return select * from (select row_number() over (order by id)as num... 阅读全文
posted @ 2015-04-17 14:16 馒头的梦想 阅读(369) 评论(0) 推荐(1)
摘要:declare @subject nvarchar(50)set @subject=(select Subject from dbo.Scores where ID=1) --select @subject=Subject from dbo.Scores where ID=1--标量 标量就是单值... 阅读全文
posted @ 2015-04-17 14:14 馒头的梦想 阅读(476) 评论(0) 推荐(1)
摘要:--计算1-100的和 declare @int int=1; declare @total int=0; while(@int<=100) begin set @total=@total+@int; set @int=@int +1; end select @total --计... 阅读全文
posted @ 2015-04-17 14:13 馒头的梦想 阅读(318) 评论(0) 推荐(1)