dbTalk Databases Forums  

how to distinguish two equal rows ...

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss how to distinguish two equal rows ... in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Antonio Miguel
 
Posts: n/a

Default how to distinguish two equal rows ... - 10-15-2003 , 12:58 PM






Hello everyone

Making some queries with MS SQL Server Enterprise manager
I have found that you can modify data directly on the
grid that shows the query result. This modifications seem
to be committed when you set the focus into another row.

It occurs to me the following: Suppose we have 2
identical rows in a table (all fields have the same
values) and I want to change a value in a field in one
and only one of the rows (so as to differentiate them in
some way). Using UPDATE it would be imposible with a
WHERE condition to tell one row from the other so
whenever I made an UPDATE query, I would change values in
both rows. However this can be done with Enterprise
Manager. You browse the table and when you get to the row
you want to change you just edit (like if it were a MS
acccess table).

The question I pose is the following:
How does enterprise manager distinguish rows? Is there an
internal row id? If there is one, Can the user have
access to this id in cases such as the above?
if not, Is there a way to UPDATE only one row of the two?

Thank you in advance for any reply
Antonio Miguel

Reply With Quote
  #2  
Old   
Robert Ellis
 
Posts: n/a

Default Re: how to distinguish two equal rows ... - 10-15-2003 , 02:32 PM






Antonio

It was always my understanding & experience (on SQL7 anyway) that this
would NOT work as you describe in EM. ie. No key means no update.

Bewildered!

Robert.

"Antonio Miguel" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello everyone

Making some queries with MS SQL Server Enterprise manager
I have found that you can modify data directly on the
grid that shows the query result. This modifications seem
to be committed when you set the focus into another row.

It occurs to me the following: Suppose we have 2
identical rows in a table (all fields have the same
values) and I want to change a value in a field in one
and only one of the rows (so as to differentiate them in
some way). Using UPDATE it would be imposible with a
WHERE condition to tell one row from the other so
whenever I made an UPDATE query, I would change values in
both rows. However this can be done with Enterprise
Manager. You browse the table and when you get to the row
you want to change you just edit (like if it were a MS
acccess table).

The question I pose is the following:
How does enterprise manager distinguish rows? Is there an
internal row id? If there is one, Can the user have
access to this id in cases such as the above?
if not, Is there a way to UPDATE only one row of the two?

Thank you in advance for any reply
Antonio Miguel



Reply With Quote
  #3  
Old   
Scott Morris
 
Posts: n/a

Default Re: how to distinguish two equal rows ... - 10-15-2003 , 02:55 PM



Two ways off hand. First is using a cursor. Second is to use "set rowcount
1; update table set ... ". I believe EM uses a cursor.

"Antonio Miguel" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello everyone

Making some queries with MS SQL Server Enterprise manager
I have found that you can modify data directly on the
grid that shows the query result. This modifications seem
to be committed when you set the focus into another row.

It occurs to me the following: Suppose we have 2
identical rows in a table (all fields have the same
values) and I want to change a value in a field in one
and only one of the rows (so as to differentiate them in
some way). Using UPDATE it would be imposible with a
WHERE condition to tell one row from the other so
whenever I made an UPDATE query, I would change values in
both rows. However this can be done with Enterprise
Manager. You browse the table and when you get to the row
you want to change you just edit (like if it were a MS
acccess table).

The question I pose is the following:
How does enterprise manager distinguish rows? Is there an
internal row id? If there is one, Can the user have
access to this id in cases such as the above?
if not, Is there a way to UPDATE only one row of the two?

Thank you in advance for any reply
Antonio Miguel



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.