Wednesday, February 15, 2012

Editing table data in Query Analyzer

Hi All !
I open a table in Query Analyzer by right clicking on it and
selecting 'Open' and when the data is displayed in the view pane I
would like to be able to edit it. It seems however that tables marked
as read only (as shown on the top bar e.g. SQL Query Analyzer - [Open
Table ServerName.DBName.dbo.TableName(read-only)] ) can not be edited
whereas the one that do not have that attribute infront of the name I
can edit. Is there a way I can change the read only attribute of a
table so that I can edit data directly in the view pane?
Please let me know if there is !
Thanks a heap ! :)

Harkirat"harry" <i1073@.tamu.edu> wrote in message
news:1105726082.290783.48450@.f14g2000cwb.googlegro ups.com...
> Hi All !
> I open a table in Query Analyzer by right clicking on it and
> selecting 'Open' and when the data is displayed in the view pane I
> would like to be able to edit it. It seems however that tables marked
> as read only (as shown on the top bar e.g. SQL Query Analyzer - [Open
> Table ServerName.DBName.dbo.TableName(read-only)] ) can not be edited
> whereas the one that do not have that attribute infront of the name I
> can edit. Is there a way I can change the read only attribute of a
> table so that I can edit data directly in the view pane?
> Please let me know if there is !
> Thanks a heap ! :)
> Harkirat

I suspect your table has no primary key (which it normally should have) or
unique index. If there's no way to identify each row in the table then you
can't edit it because there's no way to know which row you're changing. You
can still use an UPDATE statement to modify the table data of course.

Simon|||Yesssssssssss !!! That was it !! Sure wouldn't have guessed that
one...:p
Thanks a heap Simon ! :-)

Harkirat

Simon Hayes wrote:
> "harry" <i1073@.tamu.edu> wrote in message
> news:1105726082.290783.48450@.f14g2000cwb.googlegro ups.com...
> > Hi All !
> > I open a table in Query Analyzer by right clicking on it and
> > selecting 'Open' and when the data is displayed in the view pane I
> > would like to be able to edit it. It seems however that tables
marked
> > as read only (as shown on the top bar e.g. SQL Query Analyzer -
[Open
> > Table ServerName.DBName.dbo.TableName(read-only)] ) can not be
edited
> > whereas the one that do not have that attribute infront of the name
I
> > can edit. Is there a way I can change the read only attribute of a
> > table so that I can edit data directly in the view pane?
> > Please let me know if there is !
> > Thanks a heap ! :)
> > Harkirat
> I suspect your table has no primary key (which it normally should
have) or
> unique index. If there's no way to identify each row in the table
then you
> can't edit it because there's no way to know which row you're
changing. You
> can still use an UPDATE statement to modify the table data of course.
> Simon

No comments:

Post a Comment