DECLARE @CmdToExecute varchar='dir' -- displays directories
DECLARE @returncode int
EXEC @returncode = xp_cmdshell @CmdToExecute ,no_output
DECLARE @returncode int
EXEC @returncode = xp_cmdshell @CmdToExecute ,no_output
SELECT @returncode -- says whether the procedure runs successfully or not 0 denote success and 1 denotes failure
no_output -- denotes that the xp_cmdshell must not return the output or return value for the executed command
No comments:
Post a Comment