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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-01-13 : 08:45:23
|
| Nagaratna writes "Can variables of type varchar can be used while declaring a cursor?For Ex:the usual way of declaring a cursor is,Declare MyCursor Cursor FOR Select * from EmployeesInstead of this,Declare @Sql as varchar(1000)SET @Sql= Select * from EmployeesDeclare MyCursor Cursor FOR @SqlThis is returning me an arror" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-13 : 09:00:41
|
| It is possible using Dynamic SQLBut there should be better way than Cusrsor that you're trying to doPost your exact requirementMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|