寻求循环读取字段里面的值
有什么方法能读出下面的字符吗?
301\302\303\304\306\307\308\309\310\311\312\313\314\315\316\317\318\319\320\321\322\323\324\325\326\327\328\329\330\331\332\333\334\335\336\337\338\339\340\341\342\343\344\345\368\369\370\371\372\877\380\888\899\
需要把以上字符串转换为去\之后的字符串。还能不能一次读取所有数据,并3位为一个。
比如:
301
302
303
304
306
307
.....
declare @ssyfd int,@len int
select @ssyfd = max(len(ssyfd)) from t_spcxd
set @len = 3
while @len < @ssyfd
begin
select substring(ssyfd,charindex('\',ssyfd,@len)+1,3) from t_spcxd
end
如果在查询后面加where的话,可以读取,但如果是全表扫描,则读取不出来。我想是@ssyfd这个变量赋值有问题,但不知道怎么去取。