Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 new to sql server 2005 question

Author  Topic 

zapdafish
Starting Member

1 Post

Posted - 2007-01-25 : 00:32:58
hi,

I just downloaded and installed sql server 2005 express.

i created a table with two columns, nothing special at all about the columns other than to specify they are varchar

it happened that the first two rows had the exact same data. once that happened it would not let me change the values until I added a 3rd column with an identity. I just opened the table and was manually changing things around in.

just curious what was preventing me from changing the values for the first two rows. it was giving me a message 'The row value(s) updated or deleted either do not make the row unique or they alter multiple rows'


thnx..Steve

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-25 : 00:38:10
Since you had duplicate rows, SQL Server didn't allow you to change value in either of the two rows because change involved affecting multiple rows not a single one. However, you can make changes by using UPDATE query.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-01-25 : 00:41:58
The problem you had is one of the many benefits of not having a primary key on a table.

Make sure your tables always have primary keys.





CODO ERGO SUM
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-25 : 00:44:48
or at least UNIQUE constraint.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -