Sunday, March 25, 2012

Create Table Error

I'm attempting to do an exercise from Sam's Learn SQL in 24 hours with the
following syntax.
create table employee_pay_tbl
(date_hire date);
I'm getting this error and need help. IIt does not like the date data type?
I'm a beginner...
Server: Msg 2715, Level 16, State 7, Line 1
Column or parameter #1: Cannot find data type date.
That is not Transact-SQL for SQL Server, because SQL Server does not have a
data type called date (you can try DATETIME or SMALLDATETIME).
You should check out Books Online, where the syntax examples were actually
written for SQL Server. From Erland:
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Aaron Bertrand
SQL Server MVP
"mrndnjn" <u35966@.uwe> wrote in message news:75628a19d0224@.uwe...
> I'm attempting to do an exercise from Sam's Learn SQL in 24 hours with the
> following syntax.
> create table employee_pay_tbl
> (date_hire date);
> I'm getting this error and need help. IIt does not like the date data
> type?
> I'm a beginner...
> Server: Msg 2715, Level 16, State 7, Line 1
> Column or parameter #1: Cannot find data type date.
>
|||Aaron you're absolutely correct. Thank you very much for the feedback!
Aaron Bertrand [SQL Server MVP] wrote:[vbcol=seagreen]
>That is not Transact-SQL for SQL Server, because SQL Server does not have a
>data type called date (you can try DATETIME or SMALLDATETIME).
>You should check out Books Online, where the syntax examples were actually
>written for SQL Server. From Erland:
>Books Online for SQL Server 2005 at
>http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>Books Online for SQL Server 2000 at
>http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>[quoted text clipped - 8 lines]
Message posted via http://www.droptable.com

No comments:

Post a Comment