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 2000 Forums
 SQL Server Development (2000)
 cursor for exec

Author  Topic 

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2001-11-29 : 13:17:29
can you declare a cursor for an exec statement

I have a situation where a query will depend upon InvoiceType. I know I can do this with dynamic SQL but if I do the dynamic SQL can I declare a cursor for the exec of the dynamic SQL.

or can I do something like

WHERE CASE @InvoiceType
WHEN 'A' THEN ActDate = (SELECT MAX(ActDate) FROM Invoice)
WHEN 'P' THEn ExpDate = (SELECT MIN(ExpDate) FROM Invoice)
END



nr
SQLTeam MVY

12543 Posts

Posted - 2001-11-29 : 15:08:57
Why would you want to do that?

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -