Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Data from Remote SQL Server DB

Status
Not open for further replies.

barnettjacob

IS-IT--Management
Aug 12, 2011
31
GB
Hi,

I'm looking to import some data from the company SQL Server database into a local SQL Server Express DB I have created on my PC.

If I wanted to import the entire contents of the 'Inventory' table what would the code be?

Source Data:
server: ab-srv-01
db: maindb
table: Inventory

Thanks in advance.
Jacob
 
On your machine
Code:
SELECT * 
INTO Inventory
FROM [ab-srv-01].maindb.dbo.Inventory
this assumes you have permission and are in the database you want to copy to. (USE mydatabase;GO)


djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top