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 - 2001-11-12 : 09:29:33
|
| sudesh writes "Consider the following scenario,CREATE testProc (@param varchar(100))ASdeclare @curTable cursordeclare @sqlstr varchar(400)--(1)set @sqlstr = 'SELECT * FROM TEST_TABLE WHERE TESTFIELD IN (@param)'--(2)set @curTable = cursor for@sqlstr open @curTable..... /* do some operation*/......close @curTabledeallocate @curTableGOIn the above sample code i am taking param as the input parameter. Within the Stored Procedure, ie in the (1) step i will build a query using this parameter.And in the (2) step i am trying to create a cursor object using a query which is nothing but value of @sqlstr variable.But when i execute this...i am getting an error like "Incorrect Syntax Near @sqlstr" ...please help me..thanking u in advance, Sudesh shetty" |
|
|
|
|
|