惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Spread Privacy
Spread Privacy
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
N
News | PayPal Newsroom
A
Arctic Wolf
NISL@THU
NISL@THU
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Threatpost
The Last Watchdog
The Last Watchdog
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
S
Security Affairs
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
雷峰网
雷峰网
T
Tenable Blog
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
V2EX - 技术
V2EX - 技术
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Latest news
Latest news
Help Net Security
Help Net Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - seamanhy

Android Studio 安装说明 Google——Tracking Code, Map Api ASP.NET输出到Excel - seamanhy - 博客园 GridView中BoundField重复绑定数据 一个等待的小功能 MS SQL 区分大小写 盗链 防止盗链 防止图片盗链 HTML编辑器 免费编辑器 中文免费HTML编辑器 URLReWriter ASP.NET 页面跳转 伪静态页面 多参数 VBSCRIPT控制网页打印页眉和页脚 - seamanhy - 博客园 一个免费的天气预报WebService 常用正则表达式 - seamanhy - 博客园 推荐一个SQL分页函数 一些网站中经常使用的插件 PNG24在IE6中不正常显示的问题 DataSet导入到Excel文件 Google拼音输入法字库分析程序 查看SQL Server 2000执行时间 SQL Server将数据库中多行中的某个字段转换为字符串
SQL Server将字符串转换为多行
seamanhy · 2007-07-27 · via 博客园 - seamanhy

调用这个方式时输入参数(1,2,3,4,5),返回结果
Id
1
2
3
4
5

CREATE FUNCTION convertCharToMultiRows(@convertString varchar(8000), 
@strSeprate varchar(10)) RETURNS @temp TABLE (Id int
AS BEGIN DECLARE @i int
SET @convertString = rtrim(ltrim(@convertString))
SET @i = charindex(@StrSeprate@convertStringWHILE @i >= 1 BEGIN INSERT 
      
@temp
VALUES (LEFT(@convertString@i - 1))
SET @convertString = substring(@convertString@i + 1len(@convertString- @i)
SET @i = charindex(@StrSeprate@convertStringEND IF @convertString <> '\' INSERT 
      
@temp
VALUES (CONVERT(int@convertString)) RETURN END