Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Delete multiple records

$
0
0

Hi All,

I have below query ina stored procedure which deletes multiple records based on IDs

Declare @strProducts varchar(MAX)
set @strProducts = 'SELECT pt.ID from Products pt
           INNER JOIN Price pr
           ON pt.ID = pr.ID
           Where pr.price='+ cast(@intprice as varchar(5))+''

DELETE FROM Stock 
WHERE stock.IDs in(@strProducts )

I would like to now whether this is a correct way of writing a query.

Your help is appreciated.

thanks,

mds2907


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>