TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Insert data from other tables using select query
Venkatesan Jayakantham
May 03, 2012
2.2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Insert data from other tables using select query
Here is the query to insert other tables data into the existing table in sql server
insert into AdventureWorksDW2008R2.dbo.SafetyStockLevel(productID,safetystocklevel,OrderDate)
(
SELECT distinct p.ProductID, SafetyStockLevel,OrderDate
from dbo.Product p inner join
dbo.SalesOrderDetail SOD
on sod.ProductID = p.ProductID
inner join dbo.SalesOrderHeader SOH
on soh.SalesOrderID=sod.SalesOrderID
)
Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech.
http://www.kaashivinfotech.com/
Insert data from other tables using select query
Next Recommended Reading
Bulk Insert into table using User-Defined Table Type