USAGE: SQLCMD DOS Commands from T-SQL Script

by John 20. September 2007 03:00

USAGE: SQLCMD DOS Commands from T-SQL Script

Log into the local sql server, trusted account and run a DOS command.

DECLARE @vcCmd varchar(8000)
SET @vcCmd = 'sqlcmd -S' + @@SERVERNAME + ' -E -Q":!! DIR C:\"'
EXEC xp_cmdshell @vcCmd
Tags:
Categories: DOS | SQLCMD

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading