| Author |
Topic |
|
simonw2003
Starting Member
11 Posts |
Posted - 2005-07-04 : 05:05:34
|
| Im having problems getting this to work:--DECLARE @cmd sysname, @var sysnameSET @var = 'winmsd.exe'SET @cmd = @var + ' /F'EXEC master..xp_cmdshell @cmd--And have tried a simpler version:exec master..xp_cmdshell 'c:\winnt\winmsd.exe /F'Is there a work around for this, or is it simply not possible. I have tried remote and also logged in locally on the SQL server. Both SQL7 and 2000 tested.ThanksSimon |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-04 : 06:31:55
|
| It is advisible not to run exe through SQL queryMadhivananFailing to plan is Planning to fail |
 |
|
|
simonw2003
Starting Member
11 Posts |
Posted - 2005-07-04 : 06:46:07
|
| I understand that its unadvisable, however the option is there and if anyone knows how get the above to work please let me know.Many thanksSimon |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-04 : 06:54:38
|
| Can you explain why you want it to be run through SQL query?MadhivananFailing to plan is Planning to fail |
 |
|
|
simonw2003
Starting Member
11 Posts |
Posted - 2005-07-04 : 06:56:52
|
| We administer SQL servers on many sites, over 100. The command produces a diagnostic text file. Being able to generate this remotely via sql would be very convenient, and allow for automation of tasks that take real people a long time to perform. |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-07-04 : 12:44:56
|
| Have you tried using the /report option? Also, are these Windows 2000 or 2003 servers?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-07-04 : 15:32:48
|
quote: Originally posted by madhivanan It is advisible not to run exe through SQL queryMadhivananFailing to plan is Planning to fail
why is this unadvisable?EDIT:looks like Derrick has answered your question. Running apps with a GUI doesn't seem to work with xp_cmdshell, since you cannot interact wiht the buttons and such. Everything needs to be command line driven for things to work smoothly.-ec |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-05 : 01:07:32
|
quote: why is this unadvisable?
Because It will slow down SQL ServerMadhivananFailing to plan is Planning to fail |
 |
|
|
simonw2003
Starting Member
11 Posts |
Posted - 2005-07-05 : 03:01:25
|
| It was sql 7 and 2000 tested on. Win2k sp3 sp4 server and NT sp6a OS tested on.The exe in question when supplied /f is autonomus - but I guess as a gui progress bar still "pops up" perhaps SQL will not allow this to run.Thanks anyway for the help people. |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-07-05 : 19:13:48
|
| The xp_cmdshell will not allow any GUI at all, so your are correct.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|