August 25, 2008 at 7:52 pm
I can't seem to set one of my varchar() columns as a primary key. Sql server is only letting my set int columns as primary keys. Also I can't seem to create relationships based on varchar columns. When I try to create relationships, the only columns they let me select are the ones that are int. Has anyone experience this.
Please help...I don't need this right now.
August 26, 2008 at 12:09 am
Are you getting an error message? If so, what? How are you trying to set the primary key?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 26, 2008 at 1:01 am
Did you allready fill your table with data?
If so, are the values in the varchar() column unique? --> required for PK!!
August 26, 2008 at 8:37 am
You'll also want to make sure that the columns you are trying to make part of the Primary Key are defined as NOT NULL. You can't have NULL columns be part of a Primary Key.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply