SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 deletion and insertion
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

subhaoviya
Posting Yak Master

India
119 Posts

Posted - 09/07/2012 :  09:57:42  Show Profile  Reply with Quote

Is it possible to delete the records from source table after getting insertted in to destination table in single query?

with the help of outputclause or merge or...

thanks
subha

sunitabeck
Flowing Fount of Yak Knowledge

5152 Posts

Posted - 09/07/2012 :  10:00:06  Show Profile  Reply with Quote
If you are on SQL 2005 or later, you can use the output clause as you have indicated. There is a pretty good article with examples here: http://www.simple-talk.com/sql/learn-sql-server/implementing-the-output-clause-in-sql-server-2008/
Go to Top of Page

subhaoviya
Posting Yak Master

India
119 Posts

Posted - 09/07/2012 :  11:22:21  Show Profile  Reply with Quote

Really fentastic article.
thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47145 Posts

Posted - 09/08/2012 :  17:14:57  Show Profile  Reply with Quote
http://weblogs.sqlteam.com/peterl/archive/2009/04/08/Composable-DML.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000