Sql server, sql query, "IN" statement not working -



Sql server, sql query, "IN" statement not working -

this question has reply here:

creating sql table comma concatenated list 5 answers

i have query comma seperated barcodes provided. unknown reason not working:

below code not work

declare @txtbarcode varchar(max) set @txtbarcode = '2003824,2003825'; select [scan_curr_location] barcode_location_current scan_curr_barcodeno in (@txtbarcode) order [scan_curr_barcodeno] asc

however when alter single barcode works fine i.e:

set @txtbarcode = '2003824';

please advice.

thanks!

in not work that. takes comma separated list, not string comma separated values.

this work:

select [scan_curr_location] barcode_location_current scan_curr_barcodeno in ('2003824', '2003825') order [scan_curr_barcodeno] asc

sql sql-server

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -