Installing an application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created my first application and stepped through the deployment
walkthrough. I've created an deployment project which works very well.
However, I several stored procedures that need to be added to an existing
database but I'm not sure how to install the stored procedures through the
installation routine.

Any help would be appreciated.

Regards,
Johnny
 
Johnny said:
I have created my first application and stepped through the deployment
walkthrough. I've created an deployment project which works very well.
However, I several stored procedures that need to be added to an existing
database but I'm not sure how to install the stored procedures through the
installation routine.

In one of my projects I wrote a Console Application which was being run
during installation process, that application may add stored procedure by
connecting to the server through ODBC, but what I did was to make it to
prepeare (write to file) batch file (eg. "restoreRDS.bat") with stored
procedures (in my project they were restoring whole database) and then to
run so prepeared batch. As I was running it on MSDE batch file and its
stored procedures were correctly executed by SQLServer itself (directory,
connection etc. didn't really matter).

-------------------------
Process processRDS = new Process();
processRDS.EnableRaisingEvents = true;
processRDS.StartInfo.FileName = "restoreRDS.bat";
processRDS.StartInfo.UseShellExecute = false;

try
{
processRDS.Start();
processRDS.WaitForExit();
System.Threading.Thread.Sleep(5000);
System.IO.File.Delete("restoreRDS.bat");
}
catch
{
}

-------------------------

RGDS PSG

p.s. moreover what was really good, that Console Application could be run
from deployment project with arguments (in my example -restore [which was
restoring whole database] or -drop [which was dropping it during
uninstallation])
 
Thanks, I'll give that a shot.

psg said:
Johnny said:
I have created my first application and stepped through the deployment
walkthrough. I've created an deployment project which works very well.
However, I several stored procedures that need to be added to an existing
database but I'm not sure how to install the stored procedures through the
installation routine.

In one of my projects I wrote a Console Application which was being run
during installation process, that application may add stored procedure by
connecting to the server through ODBC, but what I did was to make it to
prepeare (write to file) batch file (eg. "restoreRDS.bat") with stored
procedures (in my project they were restoring whole database) and then to
run so prepeared batch. As I was running it on MSDE batch file and its
stored procedures were correctly executed by SQLServer itself (directory,
connection etc. didn't really matter).

-------------------------
Process processRDS = new Process();
processRDS.EnableRaisingEvents = true;
processRDS.StartInfo.FileName = "restoreRDS.bat";
processRDS.StartInfo.UseShellExecute = false;

try
{
processRDS.Start();
processRDS.WaitForExit();
System.Threading.Thread.Sleep(5000);
System.IO.File.Delete("restoreRDS.bat");
}
catch
{
}

-------------------------

RGDS PSG

p.s. moreover what was really good, that Console Application could be run
from deployment project with arguments (in my example -restore [which was
restoring whole database] or -drop [which was dropping it during
uninstallation])
 
Back
Top