locked
Changing data type of a column RRS feed

  • Question

  • Hi,

    I want to change data type of one column from datetime to date. When I execute following query there is error:

    alter table dbo.test

    alter column [date] date

    Error:

    Msg: 2715

    Column, parameter, or variable #11: Cannot find data type date.

    Please help.

    Tuesday, February 12, 2013 5:57 PM

Answers

  • DATE datatype was introduced in SQL 2008 and can work with SQL 2008 or later version only. It won't work with SQL 2005 or SQL 2000.
    Tuesday, February 12, 2013 6:11 PM

All replies

  • DATE datatype was introduced in SQL 2008 and can work with SQL 2008 or later version only. It won't work with SQL 2005 or SQL 2000.
    Tuesday, February 12, 2013 6:11 PM
  • Hello,

    As Chirag wrote the datatype date (Transact-SQL) was first introduced in SQL Server 2008. Please check the version of the SQL Server you are using with

    SELECT @@VERSION


    Olaf Helper

    Blog Xing

    Tuesday, February 12, 2013 7:07 PM