相关疑难解决方法(0)

将SQL Server中的字符串拆分为最大长度,将每个字符串作为一行返回

有没有办法将字符串(从特定列)拆分为n个字符而不会破坏单词,每个结果都在自己的行中?

例:

2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the PSO department  Customer states terms should be Net 60 not Net 30.  Please review signed contract for this information.
Run Code Online (Sandbox Code Playgroud)

结果:

2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the
PSO department  Customer states terms should be Net 60 not Net 30.
Please review signed contract for this information.
Run Code Online (Sandbox Code Playgroud)

我知道我可以charindex用来找到最后一个空格,但我不知道我怎么能得到剩下的空间并将它们作为行返回.

sql t-sql sql-server

5
推荐指数
1
解决办法
1万
查看次数

在MS SQL中,如何将列拆分为没有分隔符的行

我有一个表中的数据看起来像这样(值得注意的是它不是CSV分离)

它需要分成单个字符

Data
abcde
Run Code Online (Sandbox Code Playgroud)

想把它转换成这个

Data
a
b
d
c
e
Run Code Online (Sandbox Code Playgroud)

我在互联网上看了但没有找到答案

t-sql sql-server

4
推荐指数
1
解决办法
2055
查看次数

标签 统计

sql-server ×2

t-sql ×2

sql ×1