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 - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -