开发者

What is the fastest method to create a new database from a template?

We are creating databases on demand and the databases can be created from different templates. All templates have the same structure but different data. The data contained by the templates is small.

What is the fastest way to create a copy of the database:

  1. Backup/Restore
    1. Using T-SQL ?
    2. Using SMO ?
  2. Create a new database from a scripted version of the template and then开发者_Go百科 fill in the little data required ?
  3. Other ?


Possibly detach / attach.

  • Preparae master database.
  • Detach
  • Copy to new names, attach with proper syntax to redirect files.
  • Resize to proper size (I hate autoexpand for normal operations).

This makes everything a file copy, which is IIRC the fastest way. Not that there is a lot of difference, actually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜