>Borislav:
>
>That the problem, I need to create a select string that is build before the Cursor Statement is call, But the Declaration line does not allow use the @SQLStatement , so How I can execute the line after I build my statement.
I understand that, but I can't find a way HOW that cursor could be used after you create it?
DECLARE @sql varchar(2000)
SET @sql = "Select * From AOP_Financial Journal"
SET @sql = 'DECLARE TempGregorio CURSOR FOR '+@sql
EXEC (@sql)
OPEN TempGregorio
CLOSE TempGregorio
DEALLOCATE TempGregorio
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.