June 26, 2008 at 3:06 am
Hello everyone,
i was just wondering how to deploy the SQL Server express with a windows Forms application.
Currently, we are offering the Installation of SQL Express within our installation. Afterwards
we create a new Database with a SQL Script (Create Database...).
My question is: is there a "better" "easier" way to deploy a Database to an existing SQL Server express environment other than by creating it with a sql script?
Thank you for your answers!
June 27, 2008 at 4:36 pm
Think this might stir your thoughts but how about.
1. Create the database - without data in any tables
2. Detach the database from your server instance.
3. Copy the database .mdf file into your installation package
2. In your instal place the database into a defined location
3. Then exeute the Create database stored procedure 'FOR ATTACH'.
refer to:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/29ddac46-7a0f-4151-bd94-75c1908c89f8.htm
For example
CREATE DATABASE distributed
ON
(
NAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\distributed.mdf' ,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\distributed.mdf')
FOR ATTACH
my notes:
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\' is the path to your predefined installation location. Distributed.mdf should be the name of your database
Hope this stirs some thoughts and you come up with a good solution. If you think you have solved it, how about positing it here so we all can learn.
July 11, 2008 at 4:16 pm
do you mean deploy a database using a windows form or deploying sql server express using a windows form?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply