Q
Problem solve Get help with specific problems with your technologies, process and projects.

Using three part names to reference data in a separate database

Find out how to recreate data from one database into another database.

I want to create tables from one database into another database through a stored procedure- eg: I want to create all the tables in Pubs that are created on a particular date into my Northwind database (all the data that were in Pubs table must be duplicated into the Northwind database tables) - how is this done?

You need a query like the following:


CREATE PROC dbo.CopyAuthors
AS
SELECT * INTO Northwind.dbo.authors
FROM authors
GO

EXEC dbo.CopyAuthors
GO

Dig Deeper on SQL Server Stored Procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close