Create copy of existing database with new Transaction Log

  • I am looking to create a blank copy of an existing database (Houston) , and thought that the best way of doing this would be to create a new database (Dallas) & then do a restore from the last backup of Houston.

    I've done this, and this gives the basic structure of what I need. There is a large amount of data in the Houston database which needs to be deleted (in Dallas) & I have also done this.

    However, I have noted that the transaction log for the Dallas database is the same as Houston (Houston_log). I've tried & searched for a way to assign a new log file in order to unattach the Houston_log from the Dallas database, but there does not seem to be any way to do this.

    I know that I could use DTS to transfer all the tables from Houston to Dallas, but that means going through every table & recreating primary keys, indexes, referential integrity links etc.

    Can anyone assist with the log file issue, or advuse on perhaps an easier way to achieve what I am looking to do?

    Thanks in advance,

    Gary

  • Why are you worries about the log?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Simply export the Houston database to your new Dallas database using the "Copy objects and data between SQL Server databases" option, and when selecting the objects to copy, leave the defaults in place, add "Include extended properties" and uncheck "Copy data". That will then export the complete database schema to the new database, including all of your indexes, primary keys, referential integrity etc, without copying any of the actual data.

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

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