Glad to hear the topics were useful. I encourage you to download the latest
).
"Zoë Braven-Giles" <zoe.b.giles@arcadisgmi.com> wrote in message
news:OPaXEoEVHHA.4260@TK2MSFTNGP06.phx.gbl...
> Fantastic Gail. Thank you, just what I was looking for.
>
> The books I bought which said that they taught SQL turn out to only teach
> MySQL. It's very frustrating.
>
> "Gail Erickson [MS]" <gaile@online.microsoft.com> wrote in message
> news:%23aAQmgEVHHA.4668@TK2MSFTNGP04.phx.gbl...
>> Hi Zoë,
>>
>> "unsigned" is not a recognized keyword in SQL Server and the equivalent
>> to auto_increment is IDENTITY
>> With these two small changes, you're good to go.
>> create table department (dept_id smallint not null IDENTITY(1,1),
>>
>> name varchar(20) not null, constraint pk_department primary key
>> (dept_id))
>>
>> See these Books Online topics.
>>
>>
http://msdn2.microsoft.com/en-us/library/ms187745.aspx for integer data
>> type details
>>
http://msdn2.microsoft.com/en-us/library/ms186775.aspx for the IDENTITY
>> property
>> and
>>
http://msdn2.microsoft.com/en-us/library/ms174979.aspx for CREATE TABLE
>> syntax
>>
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>> Download the latest version of Books Online from
>>
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx >>
>>
>> "Zoë Braven-Giles" <zoe.b.giles@arcadisgmi.com> wrote in message
>> news:OrujXJEVHHA.5108@TK2MSFTNGP06.phx.gbl...
>>> 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
>>>
>>>
>>
>>
>
>