MSSqlServer中比较变态的游标

Posted on 2006-04-20 11:39 Raistlin 阅读(400) 评论(0)  编辑 收藏 引用 所属分类: Database

DECLARE f_Cursor CURSOR FOR

SELECT a.*
FROM OPENROWSET('SQLOLEDB','FSERVER';'sa';'x',
   'SELECT * FROM pubs.dbo.authors ORDER BY au_lname, au_fname') AS a


OPEN f_Cursor

FETCH NEXT FROM f_Cursor
WHILE @@FETCH_STATUS = 0
BEGIN
   FETCH NEXT FROM f_Cursor
END

CLOSE f_Cursor
DEALLOCATE f_Cursor

只有注册用户登录后才能发表评论。

posts - 49, comments - 14, trackbacks - 0, articles - 0

Copyright © Raistlin