locked
Duplicate JobStep.ID in the same Job - bug? RRS feed

  • Question

  • Hi,
    I'm using Smo (c#) in order to collect some informations from the jobs defined in a bunch of Sql Server 2008R2 instances: I only need to read the definitions of jobs and their steps, no alter's needed.

    Testing my application I get an exception because inside the same Job with multiple steps, more than one JobStep has the same ID, which should never be (the job steps were all created by SSMS, using the default id's - that's to say 1 and 2).

    I have tested two Jobs with 2 steps each: for each Job analyzed, peeking the Job.JobSteps collection (and the array returned by the Job.EnumJobStepsByID method as well) all the 2 elements of the list have a ID value set to 2; on the other hand, the Job.StartStepID property is correctly set to 1 (and this is actually causing the appllication to raise the exception...)

    Got any ideas?

    These are the most relevant assemblies referenced by the application:

    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.6.1055.0 built by: NETFXREL2
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.6.1075.0 built by: NETFXREL3STAGE
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.6.1055.0 built by: NETFXREL2
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    Microsoft.SqlServer.Smo
        Assembly Version: 12.0.0.0
        Win32 Version: 12.0.2000.8 ((SQL14_RTM).140220-1752)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.Smo/12.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.Smo.dll
    ----------------------------------------
    Microsoft.SqlServer.Management.Sdk.Sfc
        Assembly Version: 12.0.0.0
        Win32 Version: 12.0.2430.0 ((SQL14_RTM_QFE-CU).141015-1502)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.Management.Sdk.Sfc/12.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.Management.Sdk.Sfc.dll
    ----------------------------------------
    Microsoft.SqlServer.ConnectionInfo
        Assembly Version: 12.0.0.0
        Win32 Version: 12.0.2000.8 ((SQL14_RTM).140220-1752)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.ConnectionInfo/12.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.ConnectionInfo.dll
    ----------------------------------------
    Microsoft.SqlServer.SqlClrProvider
        Assembly Version: 12.0.0.0
        Win32 Version: 12.0.2000.8 ((SQL14_RTM).140220-1752)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.SqlClrProvider/12.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.SqlClrProvider.dll
    ----------------------------------------
    Microsoft.SqlServer.SqlEnum
        Assembly Version: 12.0.0.0
        Win32 Version: 12.0.2430.0 ((SQL14_RTM_QFE-CU).141015-1502)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.SqlEnum/12.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.SqlEnum.dll


    Thursday, August 25, 2016 3:29 PM

Answers

  • What's the exception? It would be better that you can show code here for user testing.
    Friday, August 26, 2016 8:02 AM

All replies

  • What's the exception? It would be better that you can show code here for user testing.
    Friday, August 26, 2016 8:02 AM
  • Nevermind... found the problem in code flaw, it was incrementing the ID.

    Sorry, thank you for replying.
    Friday, August 26, 2016 10:19 AM