Insert Multiple Values Into Multiple Tables in SQL Server Last Updated : 28 May, 2024 Comments Improve Suggest changes Like Article Like Report To insert multiple values into multiple tables in SQL Server, use the OUTPUT clause. The SQL OUTPUT clause allows to insert multiple values into multiple tables in a single query. Output clause clause in SQL is used to capture data affected by Data Manipulation Language (DML) statements like INSERT, UPDATE, or DELETE. SyntaxSyntax to insert multiple values into multiple tables in SQL Server is: INSERT INTO Table1 (Col1, Col2)OUTPUT inserted.Col1, inserted.Col2INTO Table2VALUES('Value1', 'Value2')GO How to Insert Multiple Values Into Multiple Tables in SQL ServerUse the OUTPUT clause with INSERT INTO statement to insert multiple values into multiple tables in the SQL server ExampleIn this example, we will insert multiple values into two tables using an INSERT INTO statement with OUTPUT clause. First we are creating 2 sample tables using the below queries: CREATE TABLE GeekTable1 ( Id1 INT, Name1 VARCHAR(200), City1 VARCHAR(200));an CREATE TABLE GeekTable2 ( Id2 INT, Name2 VARCHAR(200), City2 VARCHAR(200));GONow, let us Insert values into two tables together: INSERT INTO GeekTable1 (Id1, Name1, City1)OUTPUT inserted.Id1, inserted.Name1, inserted.City1INTO GeekTable2VALUES (1, 'Komal', 'Delhi'), (2, 'Khushi', 'Noida');GOSelect data from both the tables: SELECT * FROM GeekTable1;GOSELECT * FROM GeekTable2;GOOutput: When we run the above query, we will see that there are two rows each in the table: GeekTable1: Id1Name1City11KomalDelhi2KhushiNoidaGeekTable2: Id2Name2City21KomalDelhi2KhushiNoida Comment More infoAdvertise with us Next Article Insert Multiple Values Into Multiple Tables in SQL Server K khushboogoyal499 Follow Improve Article Tags : SQL DBMS-SQL SQL-Server Similar Reads Insert Into Select statement in MS SQL Server The INSERT INTO SELECT statement in SQL Server is a versatile feature that enables you to efficiently copy data from one or more tables into another table. This functionality is essential for tasks such as data transfer, backup creation, and data merging.In this article, We will learn to Insert Into 4 min read Select into and temporary tables in MS SQL Server In SQL Server, the SELECT INTO TEMP TABLE statement is used to select data from one or more source tables and insert it into a temporary table. Temporary tables are extremely useful when dealing with intermediate results, or when working with subsets of data within a session without modifying or aff 4 min read SQL - SELECT from Multiple Tables with MS SQL Server In SQL we can retrieve data from multiple tables also by using SELECT with multiple tables which actually results in CROSS JOIN of all the tables. The resulting table occurring from CROSS JOIN of two contains all the row combinations of the 2nd table which is a Cartesian product of tables. If we con 3 min read Join Multiple Tables Using Inner Join To retrieve data from the single table we use SELECT and PROJECTION operations but to retrieve data from multiple tables we use JOINS in SQL. There are different types of JOINS in SQL. In this article, only operations on inner joins in MSSQL are discussed. Inner Join is the method of retrieval of da 3 min read How to Query Multiple Tables in SQL SQL (Structured Query Language) is a powerful tool for managing and querying relational databases. One of its most valuable features is the ability to query multiple tables simultaneously, allowing us to retrieve and integrate related data efficiently. In this article, we will explain how to query m 4 min read Insert Statement in MS SQL Server The SQL Server INSERT statement is a fundamental command used to add new rows of data to a table. Whether we are inserting specific values, utilizing default values or copying data from another table.In this guide, weâll explore various ways to use the Insert statement in MS SQL Server with the help 4 min read Table operations in MS SQL Server In a relational database, the data is stored in the form of tables and each table is referred to as a relation. A table can store a maximum of 1000 rows. Tables are a preferred choice as: Tables are arranged in an organized manner. We can segregate the data according to our preferences in the form o 2 min read SELECT Data from Multiple Tables in SQL In SQL (Structured Query Language), it is a common requirement to retrieve data from more than one table at once. When you work with relational databases, you often have to combine data from multiple tables to get meaningful results. SQL provides many methods for selecting data from multiple tables, 4 min read How to Insert Rows with NULL Values in SQL? In SQL, due to lack of data, we sometimes need to insert rows with NULL values in the tables. Here, the keyword NULL(without quotes) is used to represent no data. There are some key points of Null value: NULL value is different from a zero value.A NULL value is used to represent a missing value, but 2 min read SQL Query to Insert Multiple Rows In SQL, the INSERT statement is used to add new records to a database table. When you need to insert multiple rows in a single query, the INSERT statement becomes efficient.In this article, We will learn different methods such as using basic INSERT statements, utilizing INSERT INTO ... SELECT for bu 4 min read Like