By default xp_cmdshell is disabled on SQL server 2005/08. You need to enable this using
sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO
you can then run OSQL command as follows
EXEC master..XP_CMDShell 'OSQL -L'
No comments:
Post a Comment