Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A cursor already exists
Message
 
 
À
05/03/2008 09:48:38
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01298878
Message ID:
01298899
Vues:
19
>>I'm getting 'Incorrect syntax near 'local'. ' in my tries. Does it work for you?
>
>Yes

In the meantime I did some reading, and found (in Scope of Transact-SQL Cursor Names)

The database option CURSOR_DEFAULT, set with the ALTER DATABASE statement, controls the default taken by the DECLARE CURSOR statement if neither LOCAL nor GLOBAL is specified. The current value for this database option is stored in the sys.databases catalog view. If the value in the column is local_cursor_default in the sys.databases catalog view is true, Transact-SQL cursors default to local. If the option is false, Transact-SQL cursors default to global. In SQL Server 2005, the database option itself defaults to FALSE (GLOBAL) to match the behavior of earlier versions of SQL Server.


BTW, there is a typo in the DECLARE CURSORS topic:

If neither GLOBAL or LOCAL is specified, the default is controlled by the setting of the default to local cursor database option. In SQL Server version 7.0, this option defaults to FALSE to match earlier versions of SQL Server, in which all cursors were global. The default of this option may change in future versions of SQL Server. For more information, see Setting Database Options.

Anyway, perhaps I can not just use one command, but if would write a whole script it may work.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform