Help deploying database tables

G

Guest

I am trying to use the Windows Installer to build a setup package for my
application. I found some good code and tools to help me redistribute MSDE
2000 with my application, but I can not figure out how to add a custom
database file to sql server from the installer. Can any one tell me how to
write, or at least point me in the right direction, a custom action for the
installer to attach a .mdf file to a desired sql server instance? Any help
would be greatly appreciated.

Chris
 
S

steve

you can call a vb script from your installer that executes a sql script
using isql.exe

ugly!!! but it works. i wasn't using MSDE, but I'm pretty sure it
includes the sql command line tool.

your vb script would look something like this:
Return = WshShell.Run("isql.exe -S " & dbServerIP & " -d database_name
-U " & dbUserName & " -P " & dbPassword & " -i " & """" & targetDir &
"\sql_script.sql" & """" & " -o " & """" & targetDir &
"\sql_script_output.txt" & """", 1, true)
 

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