Home > database >  SQL server statement for great god help!!!!!!
SQL server statement for great god help!!!!!!

Time:11-09


Want to put these statements in combination with a statement, the query MaterialExt fields in the table for the StorageId='d7 f04f5c10-1203-417 - a - 91 - ef6e98c567d9' data to two tables in MaterialExt and MaterialForLocation deleting

I am query in figure out to delete respectively, feel a little bit of a problem!!!!!
Pray god to help write a complete statement
The small white! Do not spray!!!!!!!!!!!!!!!

CodePudding user response:

Probably mean it
DELETE the FROM A table Forxxx A WHERE the EXISTS (SELECT FROM table 1 Ext WHERE B (B.s torageId='guidxxx') AND (arjun ateriaExtID=B.I D));
To delete at the same time, it is best to trigger,

CodePudding user response:

Write a stored procedure, the parameters: the StorageId
A deleted two table data can,

Trigger don't use, side effects is very big,

CodePudding user response:

A lot of problem solving method, the key is you why want to use a statement?
  • Related