Re: newbie: how convert nvchar to datetime?
- From: Jim Muir <jpmuirNoSpamPlease@xxxxxxxxx>
- Date: Sun, 23 Oct 2005 10:54:32 -0400
Hari Prasad wrote:
I tried that in the past, but I could not get this to work. But your suggestion seemed simple and likely the cleanest way to get this going.Hi,
USE ALTER TABLE with ALTER COLUMN
ALTER TABLE <table> ALTER COLUMN <Column_name> DATETIME go
Thanks Hari SQL Server MVP
"Jim Muir" <jpmuirNoSpamPlease@xxxxxxxxx> wrote in message news:%23ycuY781FHA.3256@xxxxxxxxxxxxxxxxxxxxxxx
I have imported a table into msSQL (2000)
One of the fields which was stored originally as a simple date field (05/05/05) was created as nvarchar(8).
How to I alter this column to become a DateTime field type? I want to do this before I add any more records.
The application will be sending a date like 10/23/2005 but without the time part.
A little persistence revealed the problem...
I Got an error: Arithmetic Overflow Error converting expression to data type datetime. This has been the problem. I reviewed the table column, and noticed a few dates were messed up. I corrected the bad dates only to discover that SQL Enterprise queries don't support 'Alter'
But Query Analyzer worked and all 1006 rows were changed.
Thanks !
.
- References:
- newbie: how convert nvchar to datetime?
- From: Jim Muir
- Re: newbie: how convert nvchar to datetime?
- From: Hari Prasad
- newbie: how convert nvchar to datetime?
- Prev by Date: Re: newbie: how convert nvchar to datetime?
- Next by Date: Re: update in view
- Previous by thread: Re: newbie: how convert nvchar to datetime?
- Next by thread: Re: update in view
- Index(es):
Relevant Pages
|
|