H
hyscan
Unregistered / Unconfirmed
GUEST, unregistred user!
错误提示:
服务器: 消息 16929,级别 16,状态 1,行 25
游标是 READ ONLY 的。
语句已终止。
DECLARE test_cursor CURSOR
KEYSET
FOR SELECT au_fname FROM pubs.dbo.authors
DECLARE @name varchar(40)
OPEN test_cursor
FETCH NEXT FROM test_cursor INTO @name
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
PRINT 'updating record for ' + @name
UPDATE pubs.dbo.authors
SET phone = replace(phone, ' ', '-')
WHERE CURRENT OF test_cursor
END
FETCH NEXT FROM test_cursor INTO @name
END
CLOSE test_cursor
DEALLOCATE test_cursor
GO
服务器: 消息 16929,级别 16,状态 1,行 25
游标是 READ ONLY 的。
语句已终止。
DECLARE test_cursor CURSOR
KEYSET
FOR SELECT au_fname FROM pubs.dbo.authors
DECLARE @name varchar(40)
OPEN test_cursor
FETCH NEXT FROM test_cursor INTO @name
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
PRINT 'updating record for ' + @name
UPDATE pubs.dbo.authors
SET phone = replace(phone, ' ', '-')
WHERE CURRENT OF test_cursor
END
FETCH NEXT FROM test_cursor INTO @name
END
CLOSE test_cursor
DEALLOCATE test_cursor
GO