Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Executing xp_cmdshell inside of a stored procedure

$
0
0

I am currently migrating from Sql Server 2005 to 2008R2. I have legacy code that calls a custom executable inside of a stored procedure. The procedure with this line compiles in 2005 but not 2008R2:

exec xp_cmdshell 'whoami.exe'

After some research I found that it will compile using this syntax:

exec .master..xp_cmdshell 'whoami.exe'

Please note the period before master. I have not been able to find any documentation on why the period before master is needed. Can someone please explain what the period does and why?


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>