Pages

Saturday, June 1, 2013

How to create a stored procedure for DTSRUN?

Execute the following Microsoft SQL Server T-SQL training script in SSMS Query Editor to create a sproc for DTSRUN execution :
CREATE PROC ImportFinanceData
AS
BEGIN
DECLARE @SQLCommand varchar(1000)
-- Replace it with your code
SET @SQLCommand = 'DTSRUN /S 140.242.136.106 /E /U "user" /P "password" /N
"DailyFinanceImport" '
PRINT @SQLCommand -- test & debug
EXEC master..xp_cmdshell @SQLCommand, NO_OUTPUT
END
GO
-- Execute stored procedure
EXEC ImportFinanceData
GO
Related articles:

No comments:

Post a Comment