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!

How can I import data from one SQL server to another? 1

Status
Not open for further replies.

bombplayer

Programmer
Jul 3, 2001
47
0
0
US
I have a SQL server named Register that I need to create an update procedure on another SQL server. how do I do this?
 
well if you are logged into a user that has rights to both servers and databases then you can do something like this

INSERT INTO Register.MyDatabase.DBO.Customers
SELECT ....
FROM OtherServer.MyOtherDatabase.DBO.Customers.
.
.
.


SQL server uses a 4 part name for all object
1st is the server name
2nd is the database name
3rd is the owner of the object (most often it is DBO)
4th is the actual object
SQL server also lets you span databases using this 4 part name
If you leave any part out SQL server inserts the default
the defaults are as follows
for Server it is the current server you are loged onto
for the database it is the current database you are logged into
for the owner it is the current account you are logged into but if that owner does not have the object it will use DBO
 
It would be easier (point-and-click) to use DTS from the Enterprise Manager. Do you want to copy the whole table, or are you trying to synchronize the two tables?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top