Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

SQL - Copy data from one database to another

I have a production database and a test database.  I want to update data in a table from prod to test.

Example

Prod Dbase IP 2.2.2.2 Table Employees
Test Dbase IP 1.1.1.1 Table Employees

Want to update Test database table Employee (1.1.1.1) with data from Prod database table Employee (2.2.2.2)

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CipherIS

ASKER

Thanks.  How would I write my update statement?  I'm currently linking the Prod Server to the Test Server.

I want to update the email field in table employees.

I am selecting into #temp from prod to verify the data.

UPDATE employee
SET email = #temp.email
WHERE id = #temp.id
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.