Information générale
Forum:
Microsoft SQL Server
Titre:
Query Analyzer - code not running the second time.
When I lauch the Query Analizer the first time and run some code for the first time the insertions work fine.
If I run the same code again I get a message saying the following :
The command(s) completed successfully.>
But, the problem is that the insertions did not work!.
For them to work again I will need to close the Query Analizer and open it again.
Here is the code that I run:
use vips
DECLARE @ac varchar(40)
DECLARE agency_cursor CURSOR FOR SELECT ac FROM agt_data
OPEN agency_cursor
WHILE (@@FETCH_STATUS = 0)
BEGIN
FETCH NEXT FROM agency_cursor INTO @ac
PRINT @ac
INSERT INTO pt_agency (ProducerCode) VALUES (@ac)
END
CLOSE agency_cursor
DEALLOCATE agency_cursor
GO
Thanks,
Sergio
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement