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
 General SQL Server Forums
 New to SQL Server Programming
 create table error

Author  Topic 

abundant_lyfe
Starting Member

10 Posts

Posted - 2007-02-19 : 10:52:41
Hi

Working with SQL Server 2005

I am trying to create a table with the following code

create table department
(dept_id smallint unsigned not null auto_increment,
name varchar(20) not null,
constraint pk_department primary key (dept_id)
)

but keep coming up with an error. I suspect that I am trying to use mysql (which I don't want to use!) instead of sql, but can't find the changes I need to make.

Thank you in advance

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-19 : 11:29:01
[code]CREATE TABLE Department
(
Dept_ID SMALLINT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
Name VARCHAR(20) NOT NULL
)[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

abundant_lyfe
Starting Member

10 Posts

Posted - 2007-02-19 : 11:36:39
Thank you Peter
Go to Top of Page
   

- Advertisement -