Monday, October 10, 2011

How to use Join in SQL Delete statement

 In this example we can see how to use inner join in delete statement,
While use the inner join in delete we need to specify the  table name (which we are going to delete from)after the DELETE word and this is very important.

delete DTL FROM [Table1] DTL inner join Table2 TRNS on DTL.Field1=TRNS.Field1
where DTL.Field2='...'  

No comments:

Post a Comment

SSRS - How to Parameterizing the SQL Query

We need to create separated dataset to handle the pre defined list in that dataset we will use simple select statement to define the li...