Hey all. I am no DB / query guru, so bare with me if this is dumb. I
want to run a query that provides a value and then run xp_cmdshell
using that value. Something like the following two step manual op I do
now:
(1) select packageid from v_package where pkgsourcepath like 'c:
\packages'
-- statement above will always return a single value
(2) EXEC master..xp_cmdshell 'dir /s "[value returned from query above
would go here without brackets of course]'
I just want to find a way to do this in one shot so I can batch it up
in some from that can be scheduled. Please help! This is SQL Server
2000 and I am simply using Query Analyzer. Thanks in advance.
want to run a query that provides a value and then run xp_cmdshell
using that value. Something like the following two step manual op I do
now:
(1) select packageid from v_package where pkgsourcepath like 'c:
\packages'
-- statement above will always return a single value
(2) EXEC master..xp_cmdshell 'dir /s "[value returned from query above
would go here without brackets of course]'
I just want to find a way to do this in one shot so I can batch it up
in some from that can be scheduled. Please help! This is SQL Server
2000 and I am simply using Query Analyzer. Thanks in advance.