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)
 Creating a cursor from dynamic sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-25 : 22:12:49
Jonas writes "Hi!

I have a stored procedure witch takes a string (@fooIdString varchar(1000)). The string contains comma separated id's.

I want to dynamicaly create a sql-statement string like

'SELECT * FROM foo WHERE fooId IN (' + @fooIdString + ')'

Now i want to create a cursor of the above string to be able to do some looping. How do i do this? I have triead everything but nothing seems to work with dynamic statement.

I have SQL Server 7.0 running on NT 4.0 SP 6

Thanx!

// Jonas"
   

- Advertisement -