随笔分类 -  SQLServer

SQLServer
摘要:declare @i intset @i=1while @i<30begininsert into test (userid) values(@i)set @i=@i+1end来源:http://www.cnitblog.com/malan11/articles/31153.html 阅读全文

posted @ 2012-07-26 16:48 wboweb 阅读(152) 评论(0) 推荐(0)

摘要:USE [MyDataBase]GO/****** Object: StoredProcedure [dbo].[GetVipDetails] Script Date: 07/05/2012 09:39:14 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER Proc [dbo].[GetVipDetails] @pageindex int=1 , @pagesize int=10, @VipAccount nvarchar(20)=null, --VIP账户 @VipCompanyUserI... 阅读全文

posted @ 2012-07-10 17:54 wboweb 阅读(236) 评论(0) 推荐(0)

摘要:select * from(select top m-n+1 * from (select top m * from table1 order by id asc) as table2 order by id desc) as table3 order by id 阅读全文

posted @ 2012-06-26 17:36 wboweb 阅读(229) 评论(0) 推荐(0)

摘要:truncate table 表名 阅读全文

posted @ 2012-06-26 17:18 wboweb 阅读(1541) 评论(0) 推荐(0)

摘要:用SQL语句添加删除修改字段1.增加字段alter table docdsp add dspcode char(200)2.删除字段ALTER TABLE table_NAME DROP COLUMN column_NAME3.修改字段类型ALTER TABLE table_name ALTER COLUMN column_name new_data_type4.sp_rename 改名更改当前数据库中用户创建对象(如表、列或用户定义数据类型)的名称。语法sp_rename [ @objname = ]'object_name' ,[ @newname = ] 'new 阅读全文

posted @ 2012-06-26 17:03 wboweb 阅读(214) 评论(1) 推荐(0)

导航