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
 TOTAL NEWBIE IN SQL 2005 - SOLVED!

Author  Topic 

wreyes02
Starting Member

4 Posts

Posted - 2010-02-01 : 09:16:53
Hi,

I'm new to SQL 2005. My problem is that a created a table and I assigned a field as PRIMARY KEY, but when I got to the properties and try to set the autoincrement it wont let me. So everytime I do an Insert into this table i need to manually enter the number of the field that is primary key. When I go to the option isIdentity i cant change the NO. for a YES. Dont know why! Any solution here?? Thank you!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-01 : 09:18:48
you cant alter a column to be of type identity. for that you need to use below workaround

http://www.mssqltips.com/tip.asp?tip=1397
Go to Top of Page

wreyes02
Starting Member

4 Posts

Posted - 2010-02-01 : 09:21:39
quote:
Originally posted by visakh16

you cant alter a column to be of type identity. for that you need to use below workaround

http://www.mssqltips.com/tip.asp?tip=1397



Ok. thank you for the fast response I'll read your information adn then let you all know.
Go to Top of Page

wreyes02
Starting Member

4 Posts

Posted - 2010-02-01 : 09:28:05
When I add the new Column it wont let me set the property either. :(, its like it is disabled.

Any other help?
Go to Top of Page

wreyes02
Starting Member

4 Posts

Posted - 2010-02-01 : 09:51:22
Guys I found the Solution myself, all you need to do is to Check that the DATA type of the column is set to INT, I had it as nvarchar and that data type cant autoincrement since is a set of characters and not numbers, that is why that option (isIdentity) was greyed out.

thanks anyways

Go to Top of Page
   

- Advertisement -