Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clearing Cursors
Message
 
 
À
11/06/2008 14:33:57
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01323202
Message ID:
01323208
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>This is the only thing other than a declare statement in this particular script, but each time I run it I get the error listed at the bottom.
>
>
>	Declare ChartID cursor
>		Forward_Only
>	For
>	Select Distinct
>		(P.ChartID),
>		'0' AS Processed
>		From NTSERVER.IMPACTMD.dbo.Patients P
>			Inner Join NTSERVER.IMPACTMD.dbo.Doc_Header H
>				On H.PatientID = P.PatientID
>
>
>
>Msg 16915, Level 16, State 1, Line 43
>A cursor with the name 'ChartID' already exists.
>
For cursors you need DEALLOCATE and CLOSE commands. Check the syntax in BOL.

Also there are almost always better ways than using cursors. If you use SQL Server 2005 look at CTE option.
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