I am using sqlserver 2012. i want to convert nvarchar value from a table in to an integer. How can i do it? i am using it in a stored procedure. and nvarchar value only contains numbers.
What i want to do is to multiple that nvarchar value and assign it to int variable.. When i tried it Following error comes
Select @temp = @nvarcharvalue * 2
I also tried.
Select @temp = CAST(@nvarcharvalue as int)* 2
Following error is shown.
The conversion of the nvarchar value '20130429044221' overflowed an int column.
How can it be done?
Thanks in advance