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)
 stored procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-10 : 07:56:02
zubair writes "i have written a stored procedure using TSQL containing an "in" operator, as i have to pass a list of items for e.g "zubair,farrukh".
i have a prob calling the sp as i dont know how to pass the parameters when executing the stored procedure.

here is my stored procedue, just tell me how should i execute it??

Create Procedure Search
@strIDs VarChar(100)
AS

Declare @SQL VarChar(1000)

Select @SQL = 'SELECT * FROM Products '
Select @SQL = @SQL + 'WHERE ProductID in (' + @strIDs +')'

Exec ( @SQL)

GO

how i call it from asp page and query analyzer"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-10 : 08:08:35
In your ASP page execute the sp by

con.execute(Search 'Ids')

Also refer this
http://www.mindsdoor.net/aSP/DBAccess.inc.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -