Robert Treadwell
asked on
Can't perform Create, Update or Delete operations on 'Table(Table Name)' because it has no primary key.
When I try to perform any of the above functions (Create, Update, and Delete) I receive the above error message. My Table does have a primary key called RowID datatype int. I am using LINQ to connect to my SQL database.
What else needs to be modified?
What else needs to be modified?
quick change:
alter table tablename
add idcolumn int not null identity(1,1) primary key
alter table tablename
add idcolumn int not null identity(1,1) primary key
ASKER
Thank you for your help.
I already have a Row ID column so I will need to alter it. Is this the right syntax for SQL Server 2008? The reason I ask is that when I execute it doesn't make the modifications requested.
ALTER TABLE [Annoucements Current Events]
ALTER COLUMN RowID int not null IDENTITY(1,1) primary key;
Select Top 1000 * from [Annoucements Current Events]
I already have a Row ID column so I will need to alter it. Is this the right syntax for SQL Server 2008? The reason I ask is that when I execute it doesn't make the modifications requested.
ALTER TABLE [Annoucements Current Events]
ALTER COLUMN RowID int not null IDENTITY(1,1) primary key;
Select Top 1000 * from [Annoucements Current Events]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
alter table tablename
add idcolumn int identity(1,1) primary key