Execute commands within tsql

563 Views Asked by At

How can I execute system command like dir other than xp_cmdshell?

1

There are 1 best solutions below

2
On BEST ANSWER

I dont see any problem , here is an example :

dstest is a remote server ...

enter image description here

edit

run this to activate :

EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO