Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Changing column type to datetime?

Author  Topic 

OldMySQLUser
Constraint Violating Yak Guru

301 Posts

Posted - 2008-01-18 : 11:13:22
I have a column in a table of type int. The table is set up to allow nulls for this column, and the column is currently:

NULL
NULL
NULL
20060524
NULL
NULL

When I try and change the column type to datetime, via MS SQL Server Management Studio Express, tr complains with error:

"- Unable to modify table.
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated."

How can I reach my goal please?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-18 : 11:20:51
Convert to Varchar, then to datetime.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

OldMySQLUser
Constraint Violating Yak Guru

301 Posts

Posted - 2008-01-18 : 11:36:08
Got it! Many thanks.
Go to Top of Page
   

- Advertisement -