随笔分类 -  SQl

上一页 1 2
SQl 表操作添加字段 修改字段类型
摘要:--添加表字段ALTER TABLE orderinfo ADD SumbitTime datetime NULL --修改表字段类型alter table orderinfoalter column taskState int not null 阅读全文
posted @ 2016-01-11 17:11 苏上话 阅读(368) 评论(0) 推荐(0)
SQl 游标
摘要:declare @id nvarchar(20)DECLARE My_Cursor CURSOR --定义游标FOR (select autoid from U_VoucherItems where CardNum='k006' and CardSection='B') --查出需要的集合放到游标中... 阅读全文
posted @ 2016-01-11 17:09 苏上话 阅读(125) 评论(0) 推荐(0)
SQL分割字符串,返回临时表
摘要:create function [dbo].[f_split] ( @c varchar(2000),--需要分割的字符串(例如:1,2,3,4,5 我|和|你) @split varchar(2)--分隔符(例如 , | $) ) returns @t table(col varchar(200))--返回表 as begin whil... 阅读全文
posted @ 2013-10-25 10:47 苏上话 阅读(398) 评论(0) 推荐(0)

上一页 1 2