Thursday, March 8, 2012

SQL execute command line and return results to a table

DECLARE
@CMD CHAR(200),

SELECT @CMD = 'DIR c:\'

INSERT INTO HILOCSV
EXEC MASTER.DBO.XP_CMDSHELL @CMD

No comments:

Post a Comment