--字符串分割表函数
declare @str varchar(1000)
declare @split varchar(10) declare @i int;
declare @count int; declare @ChildStr varchar(1000);
declare @splitStr varchar(1000);
declare @Index int; declare @table as table (rowId int,splitStr varchar(1000))
declare @rowID int; set @str='aaa;bbb;ccc;d;';
set @split=';';
set @i=1;
set @count=LEN(@str);
set @ChildStr=@str;
set @rowID=1; while @i<=@count
begin
set @Index= charindex(@split,@ChildStr); if @Index >0
begin
set @splitStr=SUBSTRING(@ChildStr,0,@Index); insert @table
select @rowID,@splitStr set @ChildStr=SUBSTRING(@ChildStr,@Index+1,LEN(@ChildStr)); set @rowID=@rowID+1;
set @i=@i+1;
end
else if LEN(@ChildStr)>0
begin
insert @table
select @rowID,@ChildStr --select * from @table
return;
end
else
begin
--select * from @table
return;
end end

最新文章

  1. java int与integer的区别
  2. cout中的执行顺序_a++和++a
  3. Android js相互调用
  4. linux系统各目录存储的文件类型
  5. IO端口和IO内存的区别及分别使用的函数接口
  6. Linux技巧:一次删除一百万个文件最快方法
  7. iOS开发:Swift多线程GCD的使用
  8. yii2 安装
  9. 伪静态 apache重写
  10. Ural 1297 Palindrome 【最长回文子串】
  11. Solve Error: node postinstall sh: node: command not found
  12. selenium 操作复选框
  13. flask配置文件的几种方法
  14. (zhuan) 大牛讲堂 | 算法工程师入门第二期-穆黎森讲增强学习
  15. view之自定义控件
  16. 适用于 Windows VM 的 Azure 示例基础结构演练
  17. loj10009 P1717 钓鱼
  18. P3174 [HAOI2009]毛毛虫
  19. mailto web弹出outlook发送邮件
  20. 选择如何的系统更能适合App软件开发人员?

热门文章

  1. 设计模式原则(4)--Interface Segregation Principle(ISP)--接口隔离原则
  2. React之函数中的this指向
  3. C#加解密算法
  4. 网络基础&#160;HTTP协议之缓存简介
  5. Android Studio 自动更新失败解决办法
  6. 2018-10-17 22:20:39 c language
  7. 004-React-Native--多图选择上传
  8. Azure 中 Windows 虚拟机的大小
  9. The attribute required is undefined for the annotation type XmlElementRef
  10. sql server数据导入导出方法统计