dbTalk Databases Forums  

SQL Server Agent Job vs Stored Packages

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SQL Server Agent Job vs Stored Packages in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oystein@Norway
 
Posts: n/a

Default SQL Server Agent Job vs Stored Packages - 06-07-2006 , 03:57 AM






Hi!
I got a package with a Script task(VB) that runs OK when executing under
Stored Packages, File system but fails(stays "yellow") under SQL server Agent
Jobs. I've secured the package with "EncryptAllWithPassword". I guess it
might be a security issue in Sql server agent. Anyone know how to fix this.

Thanks,

Oystein

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SQL Server Agent Job vs Stored Packages - 06-07-2006 , 05:43 AM






Hello OysteinNorway (AT) discussions (DOT) microsoft.com,


Quick question.

When you execute a package as a job , how do you see the tasks turn yellow?

Could you also tell us what the Script Task actually Does?


Allan

Quote:
Hi!
I got a package with a Script task(VB) that runs OK when executing
under
Stored Packages, File system but fails(stays "yellow") under SQL
server Agent
Jobs. I've secured the package with "EncryptAllWithPassword". I guess
it
might be a security issue in Sql server agent. Anyone know how to fix
this.
Thanks,

Oystein




Reply With Quote
  #3  
Old   
Oystein@Norway
 
Posts: n/a

Default Re: SQL Server Agent Job vs Stored Packages - 06-07-2006 , 06:13 AM



Hi again,
I know it goes "yellow" beacuse the job dosn't fail or completes. It just
says Processing...
The script starts another script(Plink_auto.sh) with Plink on the unix. And
this triggers the (start_dialogue.pl) pearl script.


Here's the script:
(some of the text is in Norwegian)


Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Diagnostics

Public Class ScriptMain
Public Sub Main()
Try
Dim RC As Boolean = start_dialogue_pl()
If RC = False Then
Dts.TaskResult = Dts.Results.Failure
Else
Dts.TaskResult = Dts.Results.Success
End If
Catch ex As Exception
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
Private Function start_dialogue_pl() As Boolean
Dim myRC As String = ""
Dim myResponse As String = ""
Dim myMessage As String = ""
Dim myError As String = ""
Dim myMelding As String = ""
Dim myProcess As New Process
myProcess.StartInfo.FileName = "D:\Automatisering\Tools\plink.exe"
myProcess.StartInfo.Arguments = "-pw XXXXXX
USERNAME (AT) 153 (DOT) 110.5.162:23 /fs/dialogue/SB1_Liv/dialtsb1/Plink_auto.sh"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.StandardOutputEncoding =
System.Text.Encoding.Default
myProcess.StartInfo.StandardErrorEncoding =
System.Text.Encoding.Default
myProcess.Start()
' myProcess.StandardInput.WriteLine(myMessage.ToChar Array)
'Thread.Sleep(3000)
myProcess.WaitForExit()
myResponse = myProcess.StandardOutput.ReadToEnd.ToString
myError = myProcess.StandardError.ReadToEnd.ToString
myRC = myProcess.ExitCode.ToString
myProcess.Close()
If myRC = "0" Then
myMelding = myResponse.Replace(vbLf, vbCrLf)
' MsgBox(myMelding)
Return True
Else
myMelding = "Feil i start av start_dialogue.pl i testdialgoue på
unix! " & myError
' MsgBox(myMelding)
Return False
End If
End Function

End Class


"Allan Mitchell" wrote:

Quote:
Hello OysteinNorway (AT) discussions (DOT) microsoft.com,


Quick question.

When you execute a package as a job , how do you see the tasks turn yellow?

Could you also tell us what the Script Task actually Does?


Allan

Hi!
I got a package with a Script task(VB) that runs OK when executing
under
Stored Packages, File system but fails(stays "yellow") under SQL
server Agent
Jobs. I've secured the package with "EncryptAllWithPassword". I guess
it
might be a security issue in Sql server agent. Anyone know how to fix
this.
Thanks,

Oystein





Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SQL Server Agent Job vs Stored Packages - 06-07-2006 , 06:19 AM



Hello OysteinNorway (AT) discussions (DOT) microsoft.com,


Ah OK , so you don't actually see it go yellow but you presume it is yellow
because it starts and does not complete (successfully or not)

Ok then this is no doubt a permissions thing or one of your processes is
wanting input from the user and has opened a dialog box.

Quote:
Hi again,
I know it goes "yellow" beacuse the job dosn't fail or completes. It
just
says Processing...
The script starts another script(Plink_auto.sh) with Plink on the
unix. And
this triggers the (start_dialogue.pl) pearl script.
Here's the script:
(some of the text is in Norwegian)
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Diagnostics
Public Class ScriptMain
Public Sub Main()
Try
Dim RC As Boolean = start_dialogue_pl()
If RC = False Then
Dts.TaskResult = Dts.Results.Failure
Else
Dts.TaskResult = Dts.Results.Success
End If
Catch ex As Exception
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
Private Function start_dialogue_pl() As Boolean
Dim myRC As String = ""
Dim myResponse As String = ""
Dim myMessage As String = ""
Dim myError As String = ""
Dim myMelding As String = ""
Dim myProcess As New Process
myProcess.StartInfo.FileName =
"D:\Automatisering\Tools\plink.exe"
myProcess.StartInfo.Arguments = "-pw XXXXXX
USERNAME (AT) 153 (DOT) 110.5.162:23 /fs/dialogue/SB1_Liv/dialtsb1/Plink_auto.sh"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.StandardOutputEncoding =
System.Text.Encoding.Default
myProcess.StartInfo.StandardErrorEncoding =
System.Text.Encoding.Default
myProcess.Start()
' myProcess.StandardInput.WriteLine(myMessage.ToChar Array)
'Thread.Sleep(3000)
myProcess.WaitForExit()
myResponse = myProcess.StandardOutput.ReadToEnd.ToString
myError = myProcess.StandardError.ReadToEnd.ToString
myRC = myProcess.ExitCode.ToString
myProcess.Close()
If myRC = "0" Then
myMelding = myResponse.Replace(vbLf, vbCrLf)
' MsgBox(myMelding)
Return True
Else
myMelding = "Feil i start av start_dialogue.pl i
testdialgoue på
unix! " & myError
' MsgBox(myMelding)
Return False
End If
End Function
End Class

"Allan Mitchell" wrote:

Hello OysteinNorway (AT) discussions (DOT) microsoft.com,

Quick question.

When you execute a package as a job , how do you see the tasks turn
yellow?

Could you also tell us what the Script Task actually Does?

Allan

Hi!
I got a package with a Script task(VB) that runs OK when executing
under
Stored Packages, File system but fails(stays "yellow") under SQL
server Agent
Jobs. I've secured the package with "EncryptAllWithPassword". I
guess
it
might be a security issue in Sql server agent. Anyone know how to
fix
this.
Thanks,
Oystein




Reply With Quote
  #5  
Old   
Oystein@Norway
 
Posts: n/a

Default Re: SQL Server Agent Job vs Stored Packages - 06-08-2006 , 12:14 AM



There is no dialogue box who needs input from a user. I've tried to check the
security settings but I'm not so familiar with this. The job is executed by
/System. Which roles should this have?

Oystein




"Allan Mitchell" wrote:

Quote:
Hello OysteinNorway (AT) discussions (DOT) microsoft.com,


Ah OK , so you don't actually see it go yellow but you presume it is yellow
because it starts and does not complete (successfully or not)

Ok then this is no doubt a permissions thing or one of your processes is
wanting input from the user and has opened a dialog box.

Hi again,
I know it goes "yellow" beacuse the job dosn't fail or completes. It
just
says Processing...
The script starts another script(Plink_auto.sh) with Plink on the
unix. And
this triggers the (start_dialogue.pl) pearl script.
Here's the script:
(some of the text is in Norwegian)
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Diagnostics
Public Class ScriptMain
Public Sub Main()
Try
Dim RC As Boolean = start_dialogue_pl()
If RC = False Then
Dts.TaskResult = Dts.Results.Failure
Else
Dts.TaskResult = Dts.Results.Success
End If
Catch ex As Exception
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
Private Function start_dialogue_pl() As Boolean
Dim myRC As String = ""
Dim myResponse As String = ""
Dim myMessage As String = ""
Dim myError As String = ""
Dim myMelding As String = ""
Dim myProcess As New Process
myProcess.StartInfo.FileName =
"D:\Automatisering\Tools\plink.exe"
myProcess.StartInfo.Arguments = "-pw XXXXXX
USERNAME (AT) 153 (DOT) 110.5.162:23 /fs/dialogue/SB1_Liv/dialtsb1/Plink_auto.sh"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.StandardOutputEncoding =
System.Text.Encoding.Default
myProcess.StartInfo.StandardErrorEncoding =
System.Text.Encoding.Default
myProcess.Start()
' myProcess.StandardInput.WriteLine(myMessage.ToChar Array)
'Thread.Sleep(3000)
myProcess.WaitForExit()
myResponse = myProcess.StandardOutput.ReadToEnd.ToString
myError = myProcess.StandardError.ReadToEnd.ToString
myRC = myProcess.ExitCode.ToString
myProcess.Close()
If myRC = "0" Then
myMelding = myResponse.Replace(vbLf, vbCrLf)
' MsgBox(myMelding)
Return True
Else
myMelding = "Feil i start av start_dialogue.pl i
testdialgoue på
unix! " & myError
' MsgBox(myMelding)
Return False
End If
End Function
End Class

"Allan Mitchell" wrote:

Hello OysteinNorway (AT) discussions (DOT) microsoft.com,

Quick question.

When you execute a package as a job , how do you see the tasks turn
yellow?

Could you also tell us what the Script Task actually Does?

Allan

Hi!
I got a package with a Script task(VB) that runs OK when executing
under
Stored Packages, File system but fails(stays "yellow") under SQL
server Agent
Jobs. I've secured the package with "EncryptAllWithPassword". I
guess
it
might be a security issue in Sql server agent. Anyone know how to
fix
this.
Thanks,
Oystein





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.