Hi There,
I have a couple of questions if you could help please.
Is there a way I can run an SQL Server 2005 script. It need to target a local database and run the script on that database.
Also is there a way to install an .exe and then add a scheduled task refering to the installed .exe
Thanks for your help.
Best Regards,
Schedule Task
Re: Schedule Task
You can run scripts from the command line by using the SQLCMD command line utility and passing it either the script.Is there a way I can run an SQL Server 2005 script. It need to target a local database and run the script on that database.
In Actual Installer go to System-Command and click Add:
Code: Select all
Command: <SystemDir>\cmd.exe
Parameters: /C sqlcmd -S myServer\instanceName -i C:\myScript.sql
Show: Normal
Timing: After Installation
This option is not supported.Also is there a way to install an .exe and then add a scheduled task refering to the installed .exe
-
- Posts: 9
- Joined: Sat Sep 04, 2010 4:44 pm
Re: Schedule Task
Hi There,
I have tried your suggestion and it does work if I specifically name where the script is located. I.E C:\Temp\Angtest.sql
What I want to do is use the installer to write all the files to the installDir and then reference the SqlScript in that directory.
I have tried "/C sqlcmd -S MatrixPC6\MatrixPC6_2000 -d TestInstaller -i <InstallDir>Angtest.Sql" but it does not work.
If I use "/C sqlcmd -S MatrixPC6\MatrixPC6_2000 -d TestInstaller -i C:\Temp\Angtest.Sql", where I give the location of the input file, it works.
How would I get over this.
Thanks for the help.
Best Regards,
I have tried your suggestion and it does work if I specifically name where the script is located. I.E C:\Temp\Angtest.sql
What I want to do is use the installer to write all the files to the installDir and then reference the SqlScript in that directory.
I have tried "/C sqlcmd -S MatrixPC6\MatrixPC6_2000 -d TestInstaller -i <InstallDir>Angtest.Sql" but it does not work.
If I use "/C sqlcmd -S MatrixPC6\MatrixPC6_2000 -d TestInstaller -i C:\Temp\Angtest.Sql", where I give the location of the input file, it works.
How would I get over this.
Thanks for the help.
Best Regards,
Re: Schedule Task
In the first cmmand line you've lost the slash (\):
<InstallDir>Angtest.Sql
change to
<InstallDir>\Angtest.Sql
<InstallDir>Angtest.Sql
change to
<InstallDir>\Angtest.Sql