Trouble converting a column of digits from string to integer .

Copper Contributor

I have tried all the suggested solutions but no success.

Does anyone have any ideas. 

To date I have tried:

Convert 

Cast

Alter

 

3 Replies

 


Does anyone have any ideas. 

@GavSol , idea on what?

You didn't provide any usefull information, exactly close to no information.

Which SQL Server version are you using? What do you want to convert where? How does the source data look like? If you get errors, which one?

 

Olaf

@GavSol  I would advise TRY_CAST ex

TRY_CAST(COLUMN  AS VARCHAR(MAX))

It will NULL values it can't convert :smile:

TRY_CAST(COLUMN AS INT)