Copying tables of different names

  • I think this should be simple but I cannot find out how to do it.  I need to append a table of one name with the identical structure, to another table in the same DB.  Can I do this in DTS?

  • Quick and dirty :

     

    Select * INTO dbo.Table2 from dbo.table1 where 1 = 0

     

    That will copy the columns only, you won't have any dri, constraints, defaults, indexes or keys.

  • In DTS, if you're using the Import/Export Wizard, the default behavior is to append to an existing destination table.  You can see this on the Column Mappings tab.

    If you've created a package and are using a Transform Data task, the default is also to append to an existing table.

    Greg

    Greg

  • what about

    insert into table_to_add

    select * from table_with_data

    ?

  • Robert, that was EXACTLY what I needed!  I could not get the syntax right.  Gosh I thought it would be simple but this is ridiculous!  Thank you so much!!!  You made my day!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply