Results 1 to 9 of 9

Thread: Copy 1 Table to another

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2009
    Location
    Ontario, Canada
    Posts
    54

    Copy 1 Table to another

    I was wondering if it is possible to copy the contents of a SQL datatable into another completely separate datatable using VB2008 Express, if they are both have the same name and table definitions. The reason for this is because I created a small program as a database learning tool, now I created a larger project and would like to import the data that I have been entering and storing on my first program.

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,495

    Re: Copy 1 Table to another

    What is the database? Access?, SQL Server? Oracle? They all provide a method to just move the data if this is a one time thing.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2009
    Location
    Ontario, Canada
    Posts
    54

    Re: Copy 1 Table to another

    Both Databases are SQL Server.

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2009
    Location
    Ontario, Canada
    Posts
    54

    Re: Copy 1 Table to another

    But neither of them have any relations to each other. They are 2 completely different databases.

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,495

    Re: Copy 1 Table to another

    does not matter open SQL Server Management Studio and there in an imprt/export option whenyou right click on a database and select tasks
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2009
    Location
    Ontario, Canada
    Posts
    54

    Re: Copy 1 Table to another

    Thanks Gary, I will try that later tonight. Again I appriciate you time. This will be the 2nd time you got me out of a jam. I will post my results and let you know how it worked out.

  7. #7
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Copy 1 Table to another

    Are these databases on the same SQL Server instance? If so, you could script out something to import / export as well. You can access different databases (as long as you have permission) via [Database].[Schema].[Table] syntax.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 2009
    Location
    Ontario, Canada
    Posts
    54

    Re: Copy 1 Table to another

    Hi Gary, sorry it took so long to get back to you but i ran into another, more serious problem that I am trying to fix. I did try that server managment program with no success. I am still going to attempt it after I find a cure for this other problem which I am posting because I need all the help I can get on it.

    http://www.vbforums.com/showthread.p...08#post3737108

    Kasracer, thanks for the advice. I am a nooby when it comes to databases. Scripting out something at this point is way over my head, but I appriciate you taking the time to reply.

  9. #9
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: Copy 1 Table to another

    Try Microsoft SQL Server Database Publishing Wizard, it will generate an SQL script, and from there you can remove the code that pertains to other tables...
    Last edited by CVMichael; Feb 24th, 2010 at 06:30 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width