|
Posted by George Shubin on 11/24/06 18:57
Thanks, Hugo.
Putting the tables in there just might be the ticket. I didn't know that
was one of the purposes of the Model database.
Thanks for the suggestions.
GS
"Hugo Kornelis" <hugo@perFact.REMOVETHIS.info.INVALID> wrote in message
news:1eacm2900qqojkaim4npoftlibmasratfm@4ax.com...
> On Tue, 21 Nov 2006 10:39:21 -0800, George Shubin wrote:
>
>>Using SQL Server 2005 Express.
>>
>>I need to periodically duplicate an entire database and rename it. Most
>>tables are empty but some are to be prepopulated. I was thinking of
>>having
>>a "template" database called perhaps "EmptyDatabase", and then copy that
>>into a freshly created database with a new name.
>>
>>Has anyone coded anything like this?
>
> Hi George,
>
> One thing you can do is add these standard tables to the "model"
> database. Each time you create a new database, it is created as a copy
> of the "model" database, so each new database will have those tables.
>
> If you don't want these tables in ALL new databases, then I'd create one
> database with the required tables and make a full backup. You can then
> create copies of that database by using RESTORE DATABASE with the WITH
> MOVE option.
>
> --
> Hugo Kornelis, SQL Server MVP
Navigation:
[Reply to this message]
|