2012-02-21 90 views
0

我有一个varchar变量像这样定义。在SQL Server 2005中分离变量值

declare @IDs varchar(50) 
set @IDs ='111,123,567,' 

现在我需要提取列表中的最后的值总是567.

@IDs的值可以是这样也

set @IDs ='56,' 

在这种情况下,我们需要只提取值

我们该怎么做?任何对此的帮助都会很大。

感谢

库马尔

+0

东西已经被问: http://stackoverflow.com/questions/314824/t-sql-opposite-to-string-concatenation-how-to-split-string-into-multiple- RECO – 2012-02-21 06:44:07

回答