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)
 Problem Executing Dynamic SQL

Author  Topic 

jitudavda
Starting Member

11 Posts

Posted - 2001-07-04 : 04:59:00
Hi I'm facing one problem in exucuting Stored Procedure . The Error is Can't convert data type varchar to numeric


Alter Procedure ShowMyMatch
(
@ProductID numeric,
@ProductIDs Varchar(500)
)
AS
SET NOCOUNT ON
EXEC('INSERT INTO MATCHLIST Select ProductID From Products Where ProductID In ('+ @Products +') And Status<>0 and Status=
(Select Status From Products Where ProductID='+ @ProductID +')')


Here @ProductID is numeric And @ProductIDs is a comma seperated list of ProductIDs which I'm passing to query.
I Required Out put as Only those productID which are having status same as the @ProductID and these productID must be from the list of ProductIDs supplied with @ProductIDs

Please reply asap.

Thank you.

Jitu

   

- Advertisement -