|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey Guys,
I have two similar records in a table. I need to delete only one record out of two. How do I do this using SQL Query Analyser ? With Best Regards, Sufiyan |
|
#2
|
|||
|
|||
|
Hi,
Please try this. First locate something in the row that you want to delete that is unique. Then run this script. USE DBname DELETE FROM DBTable WHERE ( There where clause identifies the uniqeness that you found) Then press "Shift" "F5" and if everything is alright the "F5". Ubique ! |
|
#3
|
|||
|
|||
|
Thanx buddy for your immediate response. Your response is fine but what do i do if there is no uniqueness in both the records?
Sufiyan |
|
#4
|
||||
|
||||
|
Delete both and then insert one back in.
As an aside, you may want to enforce a unique constraint on this table so that you have some way of identifying a single row.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Deleting record from Table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|