Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ruchirj07
Starting Member
37 Posts |
Posted - 2008-02-06 : 07:15:36
|
| Hi,I'm having the problem in executing the command master ..xp_cmdshell with the variableex.declare @cmd varchar(500)set @cmd = 'http://google.com'exec master ..xp_cmdshell pathoftheexecutable + @cmdthis is giving me an error.Can anybody let me know how to execute this command with variables.Ruchir |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-06 : 07:21:05
|
| You have to use dynamic sql i guess |
 |
|
|
ruchirj07
Starting Member
37 Posts |
Posted - 2008-02-06 : 07:27:22
|
| Dynamic sql is also not working!!!! |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-02-06 : 07:46:51
|
What is pathoftheexecutable?Build the string before the exec line, also master ..xp is wrong, there should be no space.declare @cmd varchar(500)set @cmd = pathoftheexecutable + 'http://google.com'exec master..xp_cmdshell @cmd |
 |
|
|
|
|
|