|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
OK Chaps.
Just been reading through the Forums and you all seem like a helpful bunch. I have a problem, I know nothing really about SQL Queries. I need to copy data from a table in one database (db1) to another table in another database (db2). I have tried to familiarise my self with the commands and have come up with a few queries that I thought should work. But so far no real joy. Each time I try to run the queries I receive an error messge that the Table already exists (this I know, I want the data copying into an existing table), I can however copy the data I need into a NEW table.....but that defeats the object really. If anyone has a sample query that I can try and test it would be much appreciated. Thanks for your time and efforts, look forward to a few replies. Mike |
|
#2
|
|||
|
|||
|
Going across databases will vary depending on the db you're using. (edit: never mind, this is the SQL Server forum, isn't it
)In SQL Server something like this should work if the table structures match INSERT INTO db2..table SELECT * FROM db1..table
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain Last edited by Doug G : November 3rd, 2004 at 12:52 PM. |
|
#3
|
|||
|
|||
|
Quote:
Structures match. I think ![]() Thankyou for your help, I really appreciate it. Although I am still running into trouble, in the example you have given me before you show how to state the database and tables that you want to use "db2..table" and "db1..table" can you explain to me what the two ".." represent, if anything. And my apologies for my lameness.....but you got to ask haven't you. Thanks in advance. |
|
#4
|
|||
|
|||
|
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > How do I copy or move data from one table to another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|