代码
DECLARE @tempFriend varchar(5000)
DECLARE rs CURSOR LOCAL SCROLL FOR
select Friend from Friend where Username = @Username
OPEN rs
FETCH NEXT FROM rs INTO @tempFriend --循环
WHILE @@FETCH_STATUS = 0
BEGIN
SET @Friend = @Friend + @tempFriend
FETCH NEXT FROM rs INTO @tempFriend
END
CLOSE rs
deallocate rs
DECLARE rs CURSOR LOCAL SCROLL FOR
select Friend from Friend where Username = @Username
OPEN rs
FETCH NEXT FROM rs INTO @tempFriend --循环
WHILE @@FETCH_STATUS = 0
BEGIN
SET @Friend = @Friend + @tempFriend
FETCH NEXT FROM rs INTO @tempFriend
END
CLOSE rs
deallocate rs