Click here to Skip to main content
16,013,322 members
Home / Discussions / Database
   

Database

 
AnswerRe: Best practise for deploying SQL Server Database? Pin
Michael P Butler3-Sep-04 21:52
Michael P Butler3-Sep-04 21:52 
GeneralRe: Best practise for deploying SQL Server Database? Pin
mav.northwind3-Sep-04 22:10
mav.northwind3-Sep-04 22:10 
GeneralRe: Best practise for deploying SQL Server Database? Pin
Michael P Butler4-Sep-04 1:04
Michael P Butler4-Sep-04 1:04 
GeneralRe: Best practise for deploying SQL Server Database? Pin
mav.northwind7-Sep-04 20:47
mav.northwind7-Sep-04 20:47 
AnswerRe: Best practise for deploying SQL Server Database? Pin
Graham Bradshaw7-Sep-04 12:41
Graham Bradshaw7-Sep-04 12:41 
GeneralRe: Best practise for deploying SQL Server Database? Pin
mav.northwind7-Sep-04 20:44
mav.northwind7-Sep-04 20:44 
GeneralRe: Best practise for deploying SQL Server Database? Pin
Mekong River7-Sep-04 21:56
Mekong River7-Sep-04 21:56 
GeneralRe: Best practise for deploying SQL Server Database? Pin
mav.northwind7-Sep-04 23:50
mav.northwind7-Sep-04 23:50 
Sure, I've done it this way now.

It consists of two parts:
1) One InstallerClass that can copy files from the installation source directory to the target directory, replacing certain parameters in the process
2) Calling osql with the script created in step 1

The database files are included as regular files in the setup project and installed in a 'Database' subdirectory of the target directory.

Then I've added a custom action that, after all the files have been installed successfully, copies an sql template file to the target directory and fills in the real path to the database files.
Another custom action then calls osql -E -i <scriptCreatedInStep1>.

The script contents are just:
exec sp_attach_db @dbname='OurDatabaseName', @filename1='$(TRGDIR)\Database\MyDB.mdf', @filename2='$(TRGDIR)\Database\MyDB_Log.ldf'
go

and $(TRGDIR) gets replaced by the directory my program gets installed to.

Works great.Big Grin | :-D

Regards,
mav
GeneralRe: Best practise for deploying SQL Server Database? Pin
Graham Bradshaw8-Sep-04 1:48
Graham Bradshaw8-Sep-04 1:48 
GeneralFormat string from database Pin
Brendan Vogt3-Sep-04 0:37
Brendan Vogt3-Sep-04 0:37 
GeneralRe: Format string from database Pin
Colin Angus Mackay3-Sep-04 1:21
Colin Angus Mackay3-Sep-04 1:21 
GeneralMS Access Workgroup setup for web user Pin
Ryan Binns2-Sep-04 14:02
Ryan Binns2-Sep-04 14:02 
GeneralRe: MS Access Workgroup setup for web user Pin
Mekong River2-Sep-04 15:18
Mekong River2-Sep-04 15:18 
GeneralRe: MS Access Workgroup setup for web user Pin
Ryan Binns2-Sep-04 16:41
Ryan Binns2-Sep-04 16:41 
GeneralRe: MS Access Workgroup setup for web user Pin
Hesham Amin4-Sep-04 6:41
Hesham Amin4-Sep-04 6:41 
GeneralRe: MS Access Workgroup setup for web user Pin
Ryan Binns5-Sep-04 23:07
Ryan Binns5-Sep-04 23:07 
GeneralADO VCL data aware components. Pin
Droiddr2-Sep-04 12:27
Droiddr2-Sep-04 12:27 
GeneralDisplay format - Price Pin
DotNet2-Sep-04 7:07
DotNet2-Sep-04 7:07 
GeneralRe: Display format - Price Pin
Anonymous5-Sep-04 18:13
Anonymous5-Sep-04 18:13 
GeneralMS SOAP problem Pin
radlerr12-Sep-04 6:09
radlerr12-Sep-04 6:09 
GeneralTiming a Procedure/Trigger Pin
asifmaniar2-Sep-04 5:06
asifmaniar2-Sep-04 5:06 
GeneralRe: Timing a Procedure/Trigger Pin
Anil Kumar Saharan2-Sep-04 6:08
Anil Kumar Saharan2-Sep-04 6:08 
GeneralAccessing SQL Database/Table/etc. Definitions Pin
matthias s.2-Sep-04 1:18
matthias s.2-Sep-04 1:18 
GeneralRe: Accessing SQL Database/Table/etc. Definitions Pin
Colin Angus Mackay2-Sep-04 1:33
Colin Angus Mackay2-Sep-04 1:33 
GeneralRe: Accessing SQL Database/Table/etc. Definitions Pin
matthias s.2-Sep-04 1:56
matthias s.2-Sep-04 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.