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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 UPDATE db entries using composite unique key

Author  Topic 

Anand.pasayat
Starting Member

1 Post

Posted - 2012-01-19 : 05:49:02
Hi,

The database table maintains uniqueness of each enty by using composite unique key technique. So here I need to update few coloms of each entry using the composite keys in the "where" clause of the UPDATE statement.

So could any pls. suggest, what's the effective way to update each entries of my db table using the composite unique key, by iterating each time those keys using a loop & updating the coloms in DB.

Thank you.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-01-19 : 07:06:28
Your request is somewhat vague - you stated that you need to use the WHERE clause - which is true, and you stated that you have composite keys, so you probably need where clause on all of those. Beyond that, hard to say what you should do without seeing more details. Can you post more details? Take a look at Brett's blog - it has guidelines on how to post so the requirements will be clearer to a reader. http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -