October 31, 2008 at 7:01 am
Hello
I am trying to change the data type of a column and i get the following error:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value '.40146' to data type int.
does anyone know what it means? and what i can do to fix it
October 31, 2008 at 7:19 am
You are trying to convert a fraction (.40146) to datatype of INT, INT datatype does not allow this try converting to a float
SELECT CAST('.40146' AS float)
October 31, 2008 at 7:58 am
Or cast to a decimal.
An integer represents a whole number without decimal places: 0, -1, 23432.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 31, 2008 at 8:09 am
Also leanr to use proper data types to store data
Failing to plan is Planning to fail
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply