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 - 2005-11-16 : 06:50:44
|
| Siva writes "/* In the cursor i want to give sql query as a parameter insteat of giving a direct querythe query i mentioned as @sql but its giving error i tried with sP_executesql also but its giving errormy program i displayed below will anybdy of u please modify this codeand rewrite a correct code or else give a solution to this problem i used northwind database */-----------------------------------------------------------------begindeclare @sql nvarchar(200),@cname nvarchar(200)set @sql="select CompanyName from customers" declare cs cursor for @sql begin open cs fetch next from cs into @cname while @@fetch_status=0 begin select @cname end close cs deallocate cs endend" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-16 : 06:56:45
|
| Explain what you are trying to doThere must be easier way than what you are doingMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|