Error: 'System.Transactions.Diagnostics.DiagnosticTrace'

  • Hi,

    I have a script task in SSIS that connects to the database and reads from a table. This task used to run fine for more than a year till yesterday when it started failing with the following error message:-

    /*****************Error Message*************/

    Code: 0x00000000

    Source: st_update_Load_Exec_Table

    Description: BANCS_LOAD_EXEC_TABLE:Failed in ScriptMain => Void Main():The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception.

    /****************************************/

    The script fails while trying to open a connection to the database. A snippet of the code is as follows:-

    /*****************************************/

    Dim tableName As String = "BANCS_LOAD_EXEC_TABLE"

    Dim chqQuery As String = Nothing

    Dim oledbConn As OleDbConnection

    Dim oledbselectDateCmd As OleDbCommand

    Dim oledbDataReader As OleDbDataReader

    Dim ODSConnectionString As String = "Provider=SQLOLEDB;Server=10.0.224.137;database=TEST_DB;User ID=username;Password=*******"

    Dim i, cnt As Integer

    oledbConn = New OleDbConnection(ODSConnectionString)

    oledbConn.Open()

    chqQuery = "SELECT BusinessDate,Status,LoadExecutionID FROM BANCS_LOAD_EXEC_TABLE WHERE LoadExecutionID = (SELECT MAX(LoadExecutionID) FROM BANCS_LOAD_EXEC_TABLE)"

    MsgBox(oledbConn.ConnectionString.ToString)

    oledbselectDateCmd = New OleDbCommand(chqQuery, oledbConn)

    oledbselectDateCmd.CommandTimeout = 600

    oledbDataReader = oledbselectDateCmd.ExecuteReader

    oledbDataReader.Read()

    If oledbDataReader.HasRows Then

    MsgBox(oledbDataReader(0).ToString)

    Else

    MsgBox("No data")

    End If

    /*****************************************/

    Please advise as a search on google or ssis forums for this error message did not provide us any definitive answers.

  • Can you give more details what is: BANCS_LOAD_EXEC_TABLE

    The error message looks very strange. This doesn't look like normal table.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Hi cozyroc,

    There is nothing special about that table. Just to prove this, I changed the query to "SELECT * FROM SYS.objects" and it still gave the same error.

    Regards,

    Prakyath

  • Can you post the error?

    It looks like permission issue. Can you try to execute the package with full permissions (administrative account) ?

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • I am running the ETL on the server as a domain admin. The only error message that it posts is as follows:-

    -----------------------------------------------------------------------------------------

    The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception.

    -----------------------------------------------------------------------------------------

    The funny thing is when I try running the same ETL from my machine and connect to the database on the same server, I am able to do so with no issues.

  • Can you execute as local admin? Your domain admin might not have all the permissions needed for the package execution.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply