Importing a SQL Database... URGENT HELP REQUIRED.

D

Db_Stuff

I have written an application in Microsoft Access. I'm currently using SQL
Server 2000 as my datatabase, and use SQLDMO to perform various functions
like Backup, Restore and copy. Now I want to create a new database from a
template database which I have backed up to a template.mdf file. Now I want
to create a new database, and then import the template file into the New
database.

Basically this is the steps that I need to follow.

1) Create Blank SQL Server Database - Can already do this.
2) Import Template database into new blank sql server database. - This is
where the problem occurs.


If there is an easier way of doing this then It will also be appreciated..
bascially If I can just specify the template file and say to the application
create me a new database from that file then it will also be fine.

Any help will be greatly appreciated!!
 
M

Mary Chipman [MSFT]

The most common solution to the problem of propagating SQLS databases
is to script them and then execute the scripts. For an example of how
this is done, download the scripts used to create Northwind and pubs
from
http://www.microsoft.com/downloads/details.aspx?FamilyId=06616212-0356-46A0-8DA2-EEBC53A68034.
Take a look at the .sql files in the Query Analyzer. You could script
the empty template database in SEM and then execute the script from
your application.

--Mary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top