473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to copy a table (with the data) from one server to another?

mikek12004
200 New Member
How to copy a table (with the data) from one server to another (the two servers are in different PCs)? Basically if I could move the data to a txt file inthe form of the insert command (like the import/export of phpmyadmin) all would be ok
Dec 3 '08 #1
16 22986
ck9663
2,878 Recognized Expert Specialist
Do you want to transfer the table in SQL Server A to SQL Server B as a table? Or you want to export the content of a table from SQL Server A to another PC?

-- CK
Dec 3 '08 #2
mikek12004
200 New Member
Tables from SQL sever A to SQL server B which is in different host (those two are not related in any way) (For the table sructure I script the table as "Create into" take the query and run it in the other SQL -with the appropriate modifications -is anything similar for the table data?)
Dec 4 '08 #3
ck9663
2,878 Recognized Expert Specialist
You can use your management studio and use the Import wizard or connect to the other SQL server through linked server and do a SELECT * INTO...

-- CK
Dec 4 '08 #4
pattr
1 New Member
you can use the sql import export wizard for copying the table structure with data.but am not sure if u are copying more than table,the relationship will exists in the new table or not.
Dec 29 '08 #5
jordan51341
2 New Member
choose destination database -->right click-->tasks-->import Data-->choose source databse ,then following the wizard choose the source table,ok?
Jan 7 '09 #6
mikek12004
200 New Member
A little different problem, how can you copy a table (with its data) from one database to another when BOTH DATABASES ARE ON THE SAME SQL server? Tried the
Expand|Select|Wrap|Line Numbers
  1. SELECT * INTO NewTable FROM existingdb.dbo.existingtable;
but then when I checked the resulting generated scripts from the 2 tables saw that the declaration of a column as primary key was gone () any suggestions?
Jan 20 '09 #7
ck9663
2,878 Recognized Expert Specialist
Kindly make a separate post for this one so that others can view and learn from this.

Thanks,

-- CK
Jan 20 '09 #8
mikek12004
200 New Member
Didn't get it, make a different post you mean start a new thread? For this case I guess the title of this post includes this question also. In any case here are a bit more details, I have a databese with some tables which get regulary updated I want these tables to be able to 'copy' them in a 'backup' database make some other arrangments to the original database and then 'post' them back. As mention above the 'SELECT INTO' command makes all my primary keys disappear, so for the tables structure I will take the create scripts generated by SQL for the tables I want and then I will populate them with an 'insert' into my problem is that before all that I want to be able to check if a table exists in the backup database and if it does to make a 'drop' so the following 'create table' command would not cause an error saw somewhere something like 'if exists' but couldn't make it to work. Again any ideas would be helpful
Jan 21 '09 #9
ck9663
2,878 Recognized Expert Specialist
SELECT INTO creates a new table. Since it's a new table, all relationship, constraints, etc will not be automatically created. This looks like a production data. What you could do is to backup the entire database twice. One is your actual backup that you can keep/archive. The other is for you to do your "other arrangements". You have to put your production database offline first so no one can change it. After you're done with your "arrangemen ts" drop your production database and use your "arranged" database as your new production.

To check if the table is existing, trythis function.

Good luck.

-- CK
Jan 21 '09 #10

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

Similar topics

6
7639
by: Kenneth Osenbroch | last post by:
Hi. I want to create a trigger that only allows delete from table A if corresponding record in table B does not exist. Any idea on how this can be done? Thanks, Kenneth.
3
4896
by: Raj | last post by:
Hi, I am trying to add some more information to the table which already has a lot a data (like 2-3000 records). The new information may be adding 2-3 new columns worth. Now my questions are: (1)Is it a good idea to add new columns to the existing table? then it will create these new columns for all old records, will it not result in wasting...
1
4042
by: Mo | last post by:
Hi, I have two datasets on two databases one remote and one local. I am trying to copy the local data into the remote. Both tables have the same structure. I use the following DataTable Remote_Table = new DataTable(); Remote_Table = dsRemote.Tables.Clone(); DataRow DR_Local = dsLocal.Tables.Select(); foreach(DataRow Local_Data...
6
6517
by: Bill | last post by:
Hi All, New to the whole .Net and C# thing but trying. In classic asp this was simple to fill a table with dynamic content and hyperlinks. Here is an example of what I am trying to do in classic asp: <table width="640" border="0" cellspacing="3" cellpadding="3"> <tr class="mcsmalltextbold"> <td>First Name</td> <td>Last Name</td>...
1
2747
by: Tomek | last post by:
Hi, I'm new in C# programming. I received an order to create application with ODBC technology. Application seems to be simple, It should copy table from database, for example SQL server, to another database, for example MySQL. I found solution with SqlBulkCopy, but I stuck with ODBC. Do you have any idea how to do that? Thank you in advance....
11
3111
by: BeckR | last post by:
Hello - Thanks for reading my post. I am a newbie when it comes to VBA programming, but have managed to do what I need to do, until now. I have an Access 2000 database (running WinXP Pro (SP3)). I have successfully created 3 recordsets in my database. What I need to do is to take the data from those 3 recordsets and put them into a...
1
1362
by: JimDavie | last post by:
Okay guys, I'm struggling with understanding how to properly update a table with values from a temp table I created from an APPEND query which provides totals information off of an applicaion database. I'm using Access 2007 and Windows XP Pro. I have the append queries working and they ouput data elements witb DATE being common. So, it...
2
4891
by: toofunny24 | last post by:
I have two tables and both have identical fields for the most part. Both tables are linked by product id. One table is used for entering actual data. Table two contains the specs/target numbers for each product. What I want to do is when I enter the product name in the form for table 1 I want it to automatically populate the data from table 2...
1
1680
by: jerome london | last post by:
I am working on a project for a class and would like to know if or how to get my data base to auto up date a table with informatiion from another table. Oh I am working with Visual Studio 2010, Any insight would be great.
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7437
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
7797
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
6032
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
5362
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
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.