Write for Us
Error Message:Msg 1058, Level 15, State 1, Line 1Cannot specify both READ_ONLY and FOR READ ONLY on a cursor declaration.
Severity level:15.
Description:This error message appears when you try to use both in the error message mentioned options in a cursor declaration.
Consequences:The SQL statement cannot be parsed and further execution is stopped.
Resolution:Errors of the Severity Level 15 are generated by the user and are corrigible by the user. The statement cannot be executed this way. You must remove one of the two options.
Versions:All versions of SQL Server.
Example(s):USE NorthwindGODECLARE myCursor CURSOR READ_ONLY FOR SELECT * FROM Northwind.dbo.Orders FOR READ ONLYOPEN myCursorFETCH NEXT FROM myCursorDEALLOCATE myCursor
Remarks:In the above example we try to declare a cursor with both options set. This raises the error.