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)
 Alter column type, help!

Author  Topic 

txk2601
Starting Member

19 Posts

Posted - 2009-09-27 : 23:55:41
I have tblSample has Times column with datetime data type.

Now, i wan't change Times to Int data type by following SQL.

ALTER TABLE tblSample
ALTER COLUMN Times Int

Then, i get a message by sql: 'Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.'

Please help me fix it. Many thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-09-28 : 00:04:51
how do you want to convert a datetime value to integer ?

example what is the integer value for '2009-09-09 09:09:09' ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -