游標類型產生的數據檢索問題
現象:
在將數據庫兼容的級別從
DECLARE MyCursor CURSOR LOCAL READ_ONLY
FOR
SELECT
Col
FROM tbname WITH(NOLOCK)
WHERE Name LIKE
AND B_Key IN(
SELECT TOP(
KeyID
FROM tbmaster WITH(NOLOCK)
WHERE Date >=
AND Date <
OPEN MyCursor
FETCH NEXT FROM MYCURSOR
WHILE (@@FETCH_STATUS=
BEGIN
FETCH NEXT FROM MYCURSOR
END
CLOSE MyCursor
DEALLOCATE MyCursor
原因
游標類型的問題
參照以上的定義
[
From:http://tw.wingwit.com/Article/program/SQL/201311/16193.html