![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
CONTINUATION to my previous post: Here is the stored procedure: SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS OFF GO IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'ExecueDTS') BEGIN PRINT 'Dropping Procedure DtsRun' DROP Procedure dbo.ExecueDTS END GO /* ================================== AUTHOR: Yama Kamyar ================================== */ ALTER Procedure dbo.ExecueDTS @ServerName VARCHAR(30), @UserName VARCHAR(30), @Password VARCHAR(30), @DTSName VARCHAR(30), @DTSPassword VARCHAR(30), --WITH ENCRYPTION --Don't use this command but only for production /* ================================================== ================= Encrypting Procedure Definitions -------------------------------- If you are creating a stored procedure and you want to make sure that the procedure definition cannot be viewed by other users, you can use the WITH ENCRYPTION clause. The procedure definition is then stored in an unreadable form. After a stored procedure is encrypted, its definition cannot be decrypted and cannot be viewed by anyone, including the owner of the stored procedure or the system administrator. ================================================== ================= */ AS DECLARE @ERROR INT -- For Hold Error Number DECLARE @CMD VARCHAR(1000)-- DTS Run Command BEGIN BEGIN TRANSACTION -- Set as No Error SET @ERROR = 0 SET @CMD = 'dtsrun /S '+@ServerName+' /U '+@UserName+' /P '+@Password+' /N '+@DTSName+' /M '+ @DTSPassword EXECUTE @ERROR = master..xp_cmdshell @CMD -- + Error Checking SELECT @ERROR = COALESCE( NULLIF ( @ERROR, 0 ), @@ERROR ) IF @ERROR <> 0 BEGIN ROLLBACK TRANSACTION RETURN @ERROR END END -- Return Error RETURN @ERROR GO GRANT EXEC ON dbo.ExecueDTS TO PUBLIC GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO When I run this procedure from SQA: EXECUTE dbo.ExecuteDTS @ServerName = 'mySERVER' @UserName = 'sa' @Password = 'www.yamabiz.com' @DTSName = 'myDTS' @DTSPassword = 'I_dont_like_FoxPro' And I get that error message I wrote in my previous message. You see when I open SQL Enterprise Manager and run the DTS puppy it doesn't fuss at all |
|
So after all the talk is done can anyone show me the walk? Thank you for reading and for your consideration, Yama Kamyar Sr. Micorsoft .NET Consultant |
![]() |
| Thread Tools | |
| Display Modes | |
| |