Quantcast
Channel: SQL Server Master Data Services forum
Viewing all articles
Browse latest Browse all 1311

Batch jobs in MDS are not being executed from the staging stored procedure called in SSIS.

$
0
0

Issue:  Batch jobs in MDS are not being executed from the staging stored procedure called in SSIS.

Overview:

Currently, we have several SSIS packages that we use to import data into entities in MDS.  Our current SSIS package perform 3 functions.

  1.       Truncate the entity staging table.
  2.       Load the entity staging table with data.
  3.       Execute the batch job to load data from the staging table to the MDS entity.

This final Execute SQL Task SQL Batch calls a stored procedure auto generated by MDS.  This stored procedure takes in 3 parameters (VersionName, LogFlag, and BatchTag).  These are used to execute the auto generated staging stored procedure in MDS.

The stg.udp_MDM_CHARGE_KEYS_Leaf stored procedure was auto generated in theMasterDataServicesDB when the MDM_CHARGE_KEYS entity was created.  The stored procedure executes a batch job to import data from the entity staging table into the MDS entity. 

The SSIS SQL Task above is mapped directly to 3 local parameters/variables.

After using the breakpoints and debugging within SSIS, we determined that the procedure generated is:

[stg].[udp_MDM_CHARGE_KEYS_Leaf]@VersionName='VERSION_1'@LogFlag=1,@BatchTag='2014/02/18 - 20:11 - CHARGE_KEYS'

Upon execution, this SQL Task should call a batch job in MDS.

If there are records to be processed, we should see an entry in the Integration Management section of our MDS instance.  It should come through with the appropriateBatch Tag and Version.  Also, the status should come in asRunning or Completed.

Problem:

Occasionally, after executing the batch job in our SSIS packages, we see an entry inIntegration Management such as the one below:


This was executed via the same SSIS package.  There is no version number associated with this entry, and therefore the status isNotRunning.  If we click Start Batches, a prompt comes to check the version name.

Once that is specified, the entry starts running.  This is not ideal, however, as the version name is already specified in our call with thestg.udp_MDM_CHARGE_KEYS_Leaf stored procedure being called.  We want the version name to appear and the batch job to start running immediately.

In order to debug the issue further, we decided to start an instance of SQL Server Profiler against theMasterDataServicesDB.  We started the Profiler and executed theSQL Batch task in SSIS.  This confirmed that we were passing in the correct parameters as our stored procedure call appeared correctly.

However, towards the end of our stored procedure call, we run into the following error.

Based on this, we investigated the stg.udp_MDM_CHARGE_KEYS_Leaf stored procedure and noticed the section of code where this was returned:


Since our BatchTag length is greater than 0, we can evaluate the first condition.  If we lay out the explicit values used for@BatchTag and @StatusDefault, our results show that@MemberCount should evaluate to greater than 0.

In this situation, the statement should skip over the @NoRecordToProcessError.

This situation is repeatable.  We have executed this package multiple times and consistently ran up against this error.  Our current software includes SQL Server 2012 as well as version 11.0.3000 of Master Data Services.  We are trying to identify any solution or workaround to allow MDS batch jobs to be called and executed from the staging stored procedure call in SSIS.  Any thoughts or insight would be very much appreciated.



Viewing all articles
Browse latest Browse all 1311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>