473,543 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy table from one SQL database to another SQL database

1 New Member
I would like to know whether it is possible to make script or anything like that, that would automatically (weekly, daily,...) copy data from table A from database A into table B, database B. Both tables have exactly same structure of columns,...

Both databases are on the same SQL server, both databaes are the same MS SQL 2005 databases.

How to proceedd???
Feb 10 '10 #1
2 2965
ck9663
2,878 Recognized Expert Specialist
try this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. select * 
  3. into <targetservername>.<targetdatabasename>.<owner>.<newtablename>
  4. from <sourceservername>.<sourcedatabasename>.<owner>.<sourcetablename>
  5.  
  6.  
Make sure:

1. You have the necessary rights to write on the target database.
2. You have target server linked to your source server.

Happy Coding!!!

~~ CK
Feb 11 '10 #2
raveengo
4 New Member
USE OPENSOURCE U CAN INSERT OR UPDATE TABLE ONE DATABSE TO ANOHTERONE.

FOR EXAMPLE

USE PUBS

INSERT INTO Categories
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=ServerNa me;User ID=MyUID;Passwo rd=MyPass'
).Northwind.dbo .Categories
WHERE CategoryID NOT IN (SELECT CategoryID FROM Categories)
Mar 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
8607
by: sbh | last post by:
I need to copy data from a table on one Oracle server to another. Scenario: Need to create a stored procedure in server a, database aa that will copy data from server b, database bb, table bbb to server a, database aa, table aaa. Let's say I have a user on server b, database bb named userB (password pw) that has rights to table bbb. Can...
11
12664
by: dixie | last post by:
If I wanted to be able to copy all of the tables in an existing database called Original.mde to another database called New.mde from a button click event in Original.mde, is there an easy way of coding it without naming every single table in Original.mde. I am looking for a way of updating a database on site without needing to access the...
4
2041
by: sparks | last post by:
1 need to copy the data in one table into another...but its from another database. tables are demographics and testdata database1 database2 demographics personid personid same in both databases eval eval same in both databases autoid autoid different testdata
7
11605
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an...
2
2649
by: Janning Vygen | last post by:
hi PGurus, i searched the archives and read the docs, because this problem shouldn't be new. But i really don't know what to search for. i am populating a database (v7.4.1) with COPY. Some triggers in the db schema fire on inserts and do some additional data manipulations, which i dont want to take place by running COPY because my data...
6
4159
by: sql_server_user | last post by:
I'm trying to copy all 440 million rows from one table in my SQL Server 2005 db to another table with a different clustering scheme. After a few test inserts that were successful (up to a million rows in 20 seconds with no problem), I crossed my fingers and went whole-hog with the naive "insert into dest_table (column1, column2, ...) select...
4
2464
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new PVS.myWS.Loader(); DataSet wsDS=load.WsLoad(); dataGrid1.DataSource=wsDS; string strConn = ConfigurationSettings.AppSettings;
2
3451
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have code that will successfully copy a record and append the information to a new record in the same table (parent table) within a form. However, there...
0
1519
by: nstefi | last post by:
Hi everybody, I installed DB2 version 7 a few times, I always had some issues with the installation. Now finally seems to be ok, but there is something weird when I want to copy a table from one system to another: In Control Center I can see 3 instances of DB2 on my local machine: DB2 (LOCAL) - containing no database DB2CTLSV - containing 2...
1
6449
by: Hamayun Khan | last post by:
hi Is it possible to copy single table from one sql server db to another db. I have two copies of same database. I deleted data from table from origional table. now i want to copy the table from other copy of the database. I cannot complete overwrite the original database because there are a lot of new data and i have no backup. Its urgent. Any...
0
7341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7584
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7729
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5880
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5258
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3385
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1809
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.