May 26, 2009 at 4:02 am
Can I insert data from a table which is on other database on the same server through query, Like I want to insert data from master.employee table into northwind.employee table. I have tried this but fail:
insert into master.employee from northwind.employee
thanx in advance
May 26, 2009 at 4:09 am
use linked server or OPENROWSET to insert the data, for more info see SQL BOL.
May 26, 2009 at 4:13 am
Is it not possible with linked server. becoz i want to do this with simple query.
May 26, 2009 at 4:34 am
If on same server nothing wrong You are just missing fully qualified name. In your case schema 🙂
something like master.dbo.employee
May 26, 2009 at 5:30 am
ok thnx this was permission problems that is y the query not working...
May 28, 2009 at 9:31 am
For real?
"insert into master..SomeUserTable"
May 28, 2009 at 9:47 am
faiz_ku (5/26/2009)
Can I insert data from a table which is on other database on the same server through query, Like I want to insert data from master.employee table into northwind.employee table. I have tried this but fail:insert into master.employee from northwind.employee
thanx in advance
If both the databases on the same server then you just need to refer the objects using three-part naming convention. For e.g.
INSERT EmployeeDB.dbo.Employees SELECT * FROM Northwind.dbo.Employees
--OR
INSERT EmployeeDB..Employees SELECT * FROM Northwind..Employees
--Ramesh
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply