Hello Dave,
Why do you want to do this from C#?
Why don't rather just add a scheduled task?
Or in SQL create a scheduled job?
If you really want to execute this from C# use Process:
System.Diagnost ics.Process myProcess = new System.Diagnost ics.Process();
myProcess.Start Info.FileName = "OSQL.exe";
myProcess.Start Info.WorkingDir ectory = "C:\";
myProcess.Start Info.Arguments = "-Usa -PmyPasword -n -Q \"BACKUP DATABASE msdb TO DISK = > 'c:\msdb.dat_ba k'\"";
myProcess.Start ();
out of memory, so it might be buggy, but give it a try.
Cheers
Pieter
I need to create an executible that will run on a nightly basis.
The executible is a simple command line statement like:
OSQL -Usa -PmyPasword -n -Q "BACKUP DATABASE msdb TO DISK =
'c:\msdb.dat_ba k'"
Is it possible to use C# to create an executible that will run this
command line statement on a scheduled basis?
If so, can anyone give me some general ideas on how to go about this?