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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Tables to DB on Another Server

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi all -

Periodically, I need to "refresh" the data that is on my Test server.

I have been using Enterprise Manager's Export tool to copy
certain tables "manually" from my Production server.

My question: How can I automate this within a stored procedure?

I want to select all fields, all rows from the named table.

Would the T-SQL look something like this...?
INSERT INTO Test_Server.frigdare.dbo.LoadId
SELECT *
FROM Production_Server.frigdare.dbo.LoadId



Is it even possible to name the Server within the INSERT statement?

Thanks for any advice.

John



 
If it's going to another server, then set up a linked server, then the insert/select will work: you need to issue the fully qualified paths of all objects when you reference a linked server.

You could also set up a DTS package that does the transfer as well...
Tom Davis
tdavis@sark.com
 
John, when you were using the Export Wizard you may have noticed that one of the last steps includes the box "Run immediately"; on that same screen there is an option to Save, allowing you to save it as a DTS job. Once saved, it can be scheduled or run manually without having to go through all the steps again.
Robert Bradley
 
Hi guys,

I have the questions and I really have no idea what happen and how to solve this. question 1: I have the tables in sql 6.5, I used acces 97/200 to link table(get external data) from sql 6.5 to access. After that, i check the table in access(the one i just linked) and i discover that I have a lots of rows contain #Deleted, then I go back to sql table and check it, and i don't have this problem. Any idea why?, please help

Question 2: After i imported some tables from sql 6.5 to access 2000, i ran the query to retrieve something, then i have the diffrent results in sql 6.5 and access 2000 even thought i used the same query. I was loosing some data in sql 6.5 but not in access, even though i used same query, tables. any help please?

thank you

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top