Description:
Query:
In this example we explain that how to Insert multiple
Tables data into another table in SQL Server. Or how to insert multiple tables
data into single table in SQL Server. Or SQL Query to insert multiple tables
data into another (single) table.
Suppose we have two table like “State” and “Country”
and we want to insert those both tables data into another table called “CountryState”.so below is the SQL
Query to insert multiple tables data into single table.
Insert into CountryState(Country,Statename)
SELECT dbo.State.StateName, dbo.Country.CountryName
FROM
dbo.Country INNER JOIN
dbo.State ON dbo.Country.Id = dbo.State.CountryId_Fk
0 comments:
Post a Comment