Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Help Needed

Author  Topic 

luispcruz
Starting Member

2 Posts

Posted - 2008-09-09 : 11:41:36

Please, could anyone help me out

I Write this simple task

USE ESTATISTICA
GO

DECLARE @nprocesso CHAR(16)
GO

CLOSE Cursor_C1
DEALLOCATE Cursor_C1
GO


DECLARE Cursor_C1 CURSOR FOR
SELECT IPRCEXEC FROM PROCESSOS
ORDER BY IPRCEXEC
GO

OPEN Cursor_C1

FETCH NEXT FROM Cursor_C1
INTO @nprocesso

WHILE @@FETCH_STATUS = 0
BEGIN

PRINT 'PROCESSO: ' + @nprocesso

FETCH NEXT FROM Cursor_C1
INTO @nprocesso

EXEC CALCULANDIAS @nprocesso

END

CLOSE Cursor_C1
DEALLOCATE Cursor_C1
GO
EXIT


But it keeps me saying:
"Must declare the scalar variable "@nprocesso""
Could anyone lend me a help??
What I'm doing wrong?!?!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-09 : 11:44:42
Remove all "GO" keywords.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

luispcruz
Starting Member

2 Posts

Posted - 2008-09-09 : 11:48:52
Yap... Thanks a lot!! It runs smoothly

Go to Top of Page
   

- Advertisement -