Link to home
Start Free TrialLog in
Avatar of adamtrask
adamtrask

asked on

editing recrods in SQL Server database

Hi,

I am using the following SQL statement in Sql Server Management Studio to retrieve the top 5 records. However, the statement displays the records but does not allow me to edit any of them.

select top (8)dDate,nName,tType from Main;

My question is how do I modify the above statement to be able to edit any of the records displayed. Thanks
Avatar of Muhammad Wasif
Muhammad Wasif
Flag of Pakistan image

I never used SQL Server, you may need to include primary key too (also try *) to be able to edit the record. Editor must have a unique identifier to each row to update it.
Avatar of adamtrask
adamtrask

ASKER

Even when I include the primary key column as in the following statement the records displayed are read only. I am not allowed to edit any of the columns.

SELECT    TOP (10) ID, dDate, tTime, nNAMe, sSubject, tType, mMonth, Remarks
FROM  Main1
ASKER CERTIFIED SOLUTION
Avatar of Muhammad Wasif
Muhammad Wasif
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank. I get it now.