November 2, 2011 at 11:13 pm
Thanks a lot.........:-)
February 3, 2012 at 9:18 am
Thanks for this. I was going nuts with syntax error until I saw your script that used th alias instead of the table name. Simple but brilliant!
thanks again.:-)
February 27, 2012 at 3:04 am
SELECT * into #tempDocFragToDelete FROM
DocumentFragmentRelationShipHistory WHERE DocumentFragmentMasterId =391
AND DocumentFragmentVersionID=1.0
DELETE a from DocumentFragmentRelationShipHistory a join #tempDocFragToDelete b
on a.DocumentFragmentMasterId = b.DocumentFragmentMasterId
where a.DocumentFragmentVersionID > b.DocumentFragmentVersionID
This one is a real running example, try this.
July 23, 2012 at 2:02 am
Hi vikash,
In my case I want to delete those data which is not selecting in below join any Help..
DELETE ord FROM Orders ord INNER JOIN Customers c(nolock) ON ord.CustomerID = c.CustomerID WHERE c.FirstName = 'vikash'
Thanks
July 23, 2012 at 2:14 am
forsqlserver (7/23/2012)
Hi vikash,In my case I want to delete those data which is not selecting in below join any Help..
DELETE ord FROM Orders ord INNER JOIN Customers c(nolock) ON ord.CustomerID = c.CustomerID WHERE c.FirstName = 'vikash'
Please create a separate thread for your problem
Also note that this is an old thread and the person you are referring to might not be online always to help you out
If you create a new thread with some sample data and DDL of the tables invloved, I am sure there are many here who can help out in no time
If you don't know how to do this, go through the link in my signature
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
July 27, 2012 at 2:51 am
Just try below code should work as its working in sqlserver2008:
DELETE FROM Orders
Where exists
(select 1 FROM Customers c WHERE Orders.CustomerID = c.CustomerID AND c.FirstName = 'vikash')
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply