Home > Archive > MS SQL Server > March 2006 > Unable to change Table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unable to change Table
Calvin Willman

2006-03-08, 8:23 pm

I'm unable to set the identity specification to true, for an nvarchar column
in a table, using either VS2005 or the Management Studio.

I want it to hold unique values, and don't know why this is happening. There
is already a primary key as id, but that shouldn't matter.

Anyway... is the database corrupt or am i missing something?

Thanks


Steen Persson (DK)

2006-03-08, 8:23 pm

Calvin Willman wrote:
> I'm unable to set the identity specification to true, for an nvarchar column
> in a table, using either VS2005 or the Management Studio.
>
> I want it to hold unique values, and don't know why this is happening. There
> is already a primary key as id, but that shouldn't matter.
>
> Anyway... is the database corrupt or am i missing something?
>
> Thanks
>
>

You can only use decimal, int, numeric, smallint, bigint, or tinyint
data type columns for the IDENTITY property.

Regards
Steen
Kalen Delaney

2006-03-09, 3:23 am


Hi Calvin

Identity and uniqueness are two different things. You can have unique
identity values but it is not guaranteed. You can create an unique index on
any column, with the identity property or not. Identity just means SQL
Server will automatically generate the values.

If you have a varchar column and want to guarantee that no duplicates are
entered, just build a unique index on the column.

--
HTH
Kalen Delaney, SQL Server MVP
www. solidqualitylearning
.com



"Calvin Willman" <anon@anon.com> wrote in message
news:%23c$DihuQGHA.6008@TK2MSFTNGP10.phx.gbl...
>
> I'm unable to set the identity specification to true, for an nvarchar
> column in a table, using either VS2005 or the Management Studio.
>
> I want it to hold unique values, and don't know why this is happening.
> There is already a primary key as id, but that shouldn't matter.
>
> Anyway... is the database corrupt or am i missing something?
>
> Thanks
>
>




Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com