Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

update only one row from 2 exactly similar rows

Posted on 2012-04-10
2
366 Views
Last Modified: 2012-04-12
there are 2 rows, with no PK.. both are exactly same.. I need to make one different with an update.. but whatever condition i give it is going to update both.. how can i update just one through tsql code?
0
Comment
Question by:25112
  • 2
2 Comments
 
LVL 11

Expert Comment

by:f_o_o_k_y
ID: 37830042
UPDATE TOP 1 table_name
SET col=val
WHERE <condition>
0
 
LVL 11

Accepted Solution

by:
f_o_o_k_y earned 500 total points
ID: 37830072
More complex example:


result:


Best Regards
Fooky
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
A professional opinion on which Apple product to buy, and a tidbit about the WWDC.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question