Re: newbie: how convert nvchar to datetime?



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.


.



Relevant Pages

  • Re: Restoring database with different COLLATION
    ... > How I can modify the COLLATION of the database after restoring it? ... as SQL Server 2000 supports different collations and sort orders for each ... ALTER DATABASE db_name ... ALTER COLUMN VARCHAR ...
    (microsoft.public.sqlserver.msde)
  • Re: Change Data Type with VB code
    ... However, it's unlikely you'd need to alter the SYSTEM.MDW, unless you've ... Doug Steele, Microsoft Access MVP ... using ALTER COLUMN did not change the data type. ...
    (microsoft.public.access.tablesdbdesign)
  • Alter Column - strange behaviour msg 5074
    ... ALTER TABLE X ALTER COLUMN V VarChar ... create table testdata ( ... create index ix_testdata_aName on testdata on ...
    (microsoft.public.sqlserver.server)
  • Why do they make it so difficult?
    ... I finally figured out the syntax to drop the constraint but it still won't ... let me add a default value as part of an ALTER COLUMN? ... Incorrect syntax near the keyword 'CONSTRAINT'. ...
    (microsoft.public.sqlserver.programming)
  • Re: Performance degradation after changing data type
    ... changes were made with 4 successive ALTER TABLE ALTER COLUMN statements ... clustered index, it might help (and be faster than creating a clustered ... I also think that using ALTER TABLE ALTER COLUMN to revert to REAL will ... So chances are you have lots of fragmentation due to the ...
    (microsoft.public.sqlserver.server)