Conversion failed when converting the varchar value to data type int

Posted by desi on Stack Overflow See other posts from Stack Overflow or by desi
Published on 2010-04-16T15:58:31Z Indexed on 2010/04/16 16:03 UTC
Read the original article Hit count: 128

Filed under:
|
|
|

*I have a varchar(1000) column declared as field that contains all numbers, as shown below. And I want to execute the following script. I need this to work please

Declare @PostalCode varchar(1000)=0
    set @PostalCode ='7005036,7004168,7002314,7001188,6998955'

Select hl.* From CountryLocation cl
INNER JOIN refPostalCodes pc ON pc.PostalCode = hl.PostalCode
where pc.Postalcode in (@PostalCode) and pc.notDeleted = 1

© Stack Overflow or respective owner

Related posts about t-sql

Related posts about tsql