sql - How can I convert string '1234-2345' to integer? -


how can convert string integer?

declare @string nvarchar(30)='1234-2345' 

how can convert @string integer type?

you can remove dash , cast result integer. select cast(replace('1234-2345','-','') int)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - How can I echo out this array? -

javascript - IE11 incompatibility with jQuery's 'readonly'? -