![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL Server学习笔记
文章平均质量分 71
TheMoment_Rain
有所思,有所悟,有所为,有所成
展开
-
分页的sql代码
推荐使用select UserName from( select UserName, ROW_NUMBER() OVER (order by UserName) as Pos from UserInfo) as Twhere T.Pos > 1 and T.Pos 5其他实现取第11—20条记录select top 10 * from users where username not in(原创 2006-12-15 13:03:00 · 705 阅读 · 0 评论 -
逆规范化数据列表
declare @col varchar(5000)set @col=;select @col=@col+ convert(varchar(15),a.d,107)+, from(select name as d from syscolumns where id=object_id(listdata)and name not in(listid)) as aprint le原创 2006-12-15 13:04:00 · 961 阅读 · 0 评论 -
T9输入法在SQL Server2005 中的实现
Create table NumberToChar ----------用来保存数字和字母之间映射的表( number int, GetText varchar(10))--字典表select * from Dictionary--联系人表select * from Contact--创建键盘表-------------------------------------原创 2006-12-15 13:14:00 · 1346 阅读 · 0 评论 -
rpg game实现
set nocount ondrop proc lookcreate proc lookas begin declare @nowRoomID int,@nowRoomName nvarchar(50) select @nowRoomID=RoomID from nowRoom select @nowRoomName=roomName from Room where RoomID=@no原创 2006-12-15 13:16:00 · 939 阅读 · 0 评论 -
问卷调查在SQL Server2005 中的实现
Create Database MobileCalluse MobileCall--问题类别Create table QuestionTypes( QuestionTypeID int primary key identity, QuestionType varchar(20) not null unique)--问卷类别Create table QuestionnaircTypes( Qu原创 2006-12-15 13:18:00 · 1351 阅读 · 0 评论 -
SQL Server 作业
Use Demogocreate proc proc4asdeclare @iSalary intset @iSalary = (select Sum(salary) from emp)print @iSalarygoexec proc4create proc proc5( @iSalary int output)asset @iSalary = (select Sum(salary) fro原创 2006-12-15 13:32:00 · 1326 阅读 · 0 评论 -
有用的SQL脚本
--判断一个表是否已经存在if exists(select * from sysobjects where name=Person and xtype=u) print Exelse print No Ex--判断指定的表是否存在,存在则删除if exists (select * from sysobjects where objectproperty(object_id(t原创 2006-12-15 13:21:00 · 823 阅读 · 0 评论 -
SQL Server 2005 考试(包括答案)
/**//* Question 1 Can you use a batch SQL or store procedure to calculating the Number of Days in a Month?I am trying to find a way to calculate the total number of days in each month. I am tryin原创 2006-12-15 13:25:00 · 1710 阅读 · 0 评论