SQL Server multiple table removal

Source: Internet
Author: User

The first step:

Build table

CREATE table t1 (x int, y int);
CREATE table t2 (x int, y int);
Go

INSERT into T1 (x, Y) VALUES (2,3), (3,4), (4,5), (5,6);
INSERT into T2 (x, Y) values (2,3);
Go

Step Two:

Delete Related rows in the T1 table

Delete a

From T1 as a inner joins T2 as B on a.x=b.x;

Step Three:

The second step is to remove the two lines (2,3) from the T1 table. But be careful that the delete here can delete only one table, and you cannot delete multiple tables at the same time. This is a different place from MySQL.

Fourth Step:

Multiple tables can be deleted simultaneously in MySQL

Delete A, b

From T1 as a inner joins T2 as B on a.x=b.x;

SQL Server multiple table removal

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.