Forum Discussion

GavSol's avatar
GavSol
Copper Contributor
Jun 24, 2022

Trouble converting a column of digits from string to integer .

I have tried all the suggested solutions but no success.

Does anyone have any ideas. 

To date I have tried:

Convert 

Cast

Alter

 

  • olafhelper's avatar
    olafhelper
    Bronze Contributor

     


    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

  • gameday's avatar
    gameday
    Copper Contributor

    GavSol  I would advise TRY_CAST ex

    TRY_CAST(COLUMN  AS VARCHAR(MAX))

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