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

Replace function in where clause IN (list)

$
0
0

DECLARE @DNNo NVARCHAR(15), @InvDNNo NVARCHAR(200)
SELECT @DNNo='11-0748-DN01', @InvDNNo='11-0748-DN01,11-0748-DN02,11-0748-DN03,11-0748-DN04'

Select 1 Where @DNNo IN (''''+ REPLACE(@InvDNNo,',',''',''') + '''' )

It must be worked as per syntax, but it doesn't

Anybody can help me out?

Thanks & regards

Abdul Rahiman


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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