Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add a row to when a column is read only?

Status
Not open for further replies.

Athanasopolous

Programmer
Jun 25, 2005
40
US
How do I add a row to when a column is read only? I think this issue I am having is because I am using an ID field (column) that is automatically generated and incremented whenever a new row is added in Microsoft SQl Server Management Studio, I cannot manually change an ID field and it appears a different (grayer) color.

Somehow, once, after I entered all the other items in the row and hit "Enter" on my keyboard, I managed to have a row added and the ID field was automatically generated. The problem is that it did not seem to add it out of sequence. I do not know why it would be 159 and not 157

stuck_zps00d884e5.png


I deleted the row and tried again. This time, it gave me an error:

stuck02_zpsf175086e.png


When I try to edit the field by hand, it seems i am not allowed to:

stuck03_zpse022ed98.png


Please advise.

I am using SQL Server 2008 R2

Here are the version numbers:

Microsoft SQL Server Management Studio 10.50.2500.0
Microsoft Analysis Services Client Tools 10.50.2500.0
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 9.0.8112.16421
Microsoft .NET Framework 2.0.50727.5466
Operating System 6.1.7601
 
Hi,

If you insert into an indenitity field it will give you the next one it has on the list. This will not neccessarily be the next one in the table.

For example if its an increment of one. If you had records 1,2,3,4,5 then you delete 4 and 5. Then insert another it will be 6.

Dan

----------------------------------------

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top