Copying complete table from one MSSQL database toanother

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Copying complete table from one MSSQL database toanother

    I will soon have to move a complete table from one database to another (including the table structure and data in the table).

    Is there an easy way to do this? Both are MSSQL databases.

    Thanks!
    lther Guest

  2. Similar Questions and Discussions

    1. table alias mssql problem
      I get this error: The column prefix 'F' does not match with a table name or alias name used in the query. with the query below Any ideas as...
    2. copying a row from one table to another?
      how do I copy a row from one table to another? I thought it might be something like SELECT...INTO, but I could be wrong.
    3. Trouble copying data from old table to new table
      Hello all, I am working with a ColdFusion MX 6.1 frontend and a SQL Server 2000 backend - There is a "CUSTOMER_INFO" table for every month and...
    4. Forms...Copying data from one table to another
      Using Access 2000, I have four tables and two forms. The first form will update the table "Master" with three fields, one of which is StudyNumber,...
    5. Copying entire table
      Hi, I need to copy an entire table on MS SQL DB, along with all indexes and primary key. And I need to do this from an VC++ application that uses...
  3. #2

    Default Re: Copying complete table from one MSSQL database to another

    lther wrote:
    > I will soon have to move a complete table from one database to another (including the table structure and data in the table).
    >
    > Is there an easy way to do this? Both are MSSQL databases.
    >
    > Thanks!
    SQL Server's DTS functionality will handle this--you just point one
    server to the other and it will copy straight over.

    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  4. #3

    Default Re: Copying complete table from one MSSQL database toanother

    Thanks for the reply. I don't have access to the DTS Import/Export Wizard... Is there a way to do it through some sort of a query (either ColdFusion or MSSQL)?
    lther Guest

  5. #4

    Default Re: Copying complete table from one MSSQL database toanother

    Perhaps by using SELECT INTO (see SQL Server Books Online).

    The SELECT INTO statement creates a new table and populates it with the result
    set of the SELECT. The structure of the new table is defined by the attributes
    of the expressions in the select list, for example:

    SELECT Shippers.*, Link.Address, Link.City,
    Link.Region, Link.PostalCode
    INTO NewShippers
    FROM Shippers
    JOIN LinkServer.DB.dbo.Shippers AS Link
    ON (Shippers.ShipperID = Link.ShipperID)

    SELECT INTO can be used to combine data from several tables or views into one
    table. It can also be used to create a new table containing data selected from
    a linked server.

    Phil


    paross1 Guest

  6. #5

    Default Re: Copying complete table from one MSSQL database toanother

    I don't think Phil's solution will create the table with any keys or
    identities. So you may need to do this manually.

    The best/easist way is to use enterprise manager, just right click on the
    table and export it.

    Ken

    The ScareCrow Guest

  7. #6

    Default Re: Copying complete table from one MSSQL database toanother

    I agree. Of course, if he had access to Enterprise Manager, he would have access to DTS Import/Export Wizard, which, as previously stated, was not the case.

    Phil
    paross1 Guest

  8. #7

    Smile Re: Copying complete table from one MSSQL database toanother

    IN MSSQL Server Does not Support to IN BACKUP_TestDB but my sql is working. how can i resolve. Without that IN 'BACKUP_TestDB' we can copy the data into new table call PersonOrdered

    SELECT P.FirstName, O.OrderNo
    INTO PersonOrdered IN 'BACKUP_TestDB'
    FROM Person AS P
    INNER JOIN [Order] AS O
    ON P.P_Id=O.P_Id
    sameel85@gmail.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139