|
-
October 15th, 2001, 01:31 PM
#1
Copy SQL Server table
I have two SQL Server databases with the same table. One of the tables gets updated by the user. How can I copy the updated table to the table in the other database when a user clicks on a VB cmd button "update table".
Thanks for your help.
-
October 15th, 2001, 02:57 PM
#2
Re: Copy SQL Server table
Execute the following SQL
sSQL = "insert into db2.dbo.table2 select * from db1.dbo.table1"
conn.Execute sSQL
Iouri Boutchkine
[email protected]
-
October 15th, 2001, 04:19 PM
#3
Re: Copy SQL Server table
Iouri,
Will this code append to the existing rows or replace all the rows? I need to replace all existing rows. Essentially, I want to re-create the table.
Thanks!
-
October 16th, 2001, 03:29 AM
#4
Re: Copy SQL Server table
Re-create? Then you can drop all from first table, and after that insert form the second.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
October 16th, 2001, 08:42 AM
#5
Re: Copy SQL Server table
It will append rows. As Cimperiali said you can delete records from the table and then append.
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|