copy only structure from table A to table B

  • hi all..

    any1 knows how to copy only the structure of table A to table B? i dont know the script.

  • right click on table in MS and script to create as new query.

    There are some good books available on sql 2005 !!

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Another way:

    select * into TableB from TableA where 1 = 2

    Be sure TableB does not exist.  Also this will not copy indexes, constraints, etc.

     

  • Or from Management Studio you could use the export wizard to export only the table and its assoc indexes etc. to the target DB.

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

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