staging procedures without a UserName? default = 0...?
-
Montag, 7. Januar 2013 14:42
Hi All
I was just wondering where i can set the logging username (ie. the enterusername) when i call the stg.Entity_Leaf procedures.
In the old mds we are using different usernames when staging data. This seems differrent i MDS 2012?
Scenario:
We are upgrading Our Customer solution (built in MDS 2008 R2) to MDS 2012 SP1. We are using the staging tables to type in customers (from a “Customer Wizard” in SharePoint), we are using the “EnterUserName” to delegate responsibility to different members of the master data team. As I can see the stg.udp_name_Leaf Procedure does not take any username as the Creator of the member. And the stg.Entity_Leaf table does not hold any metadata column to tell MDS which user actually created the member (like in the old staging process). What can I do to set the EnterUserName, or is our approach wrong?
/mm
MM
- Bearbeitet Biz_mm Dienstag, 8. Januar 2013 08:57
Alle Antworten
-
Dienstag, 22. Januar 2013 03:11Moderator
I also need to see enter user but seemed the feature discontinued in 2012. I have to query [mdm].[tblTransaction] meta table for the workaround. Hope this helpfully.
Thanks,
Jerry -
Montag, 4. Februar 2013 07:58
Hi<o:p></o:p>
Ok, so I am not the only one the whole world wondering
why they have changed this...Could someone from Microsoft MDS team please
elaborate on this? Is It possible via the WS API, or how should this be tackled.@Jerry how does querying the transaction table help?
all transactions that are staged though the procedure is defaulting to the user
id 0 (Service Account). Please explain, it might be useful :)/MM<o:p></o:p>
MM
-
Montag, 4. Februar 2013 08:22Moderator
Hi MM
as a workaround, maybe you could create a new sp based on your stg.udp_name_Leaf Procedure, and that takes @user_id as an input parameter
(i did not test it yet)
original sp:
ALTER PROCEDURE [stg].[udp_TestEntity_Leaf] @VersionName NVARCHAR(50), @LogFlag INT=NULL, @BatchTag NVARCHAR(50)=N'', @Batch_ID INT=NULL WITH EXECUTE AS 'mds_schema_user' AS BEGIN SET NOCOUNT ON; DECLARE @UserName NVARCHAR(100), @Model_ID INT, @Version_ID INT, @VersionStatus_ID INT, @VersionStatus_Committed INT = 3, @Entity_ID INT, @MemberCount INT = 0, @ErrorCount INT = 0, @NewBatch_ID INT = 0, @GetNewBatch_ID INT = 0, @CurrentHierarchy_ID INT, @User_ID INT = 0, -- The user ID used for logging is 0.
modified sp:
ALTER PROCEDURE [stg].[udp_TestEntity_Leaf] @VersionName NVARCHAR(50), @LogFlag INT=NULL, @BatchTag NVARCHAR(50)=N'', @Batch_ID INT=NULL, @User_ID INT=0 WITH EXECUTE AS 'mds_schema_user' AS BEGIN SET NOCOUNT ON; DECLARE @UserName NVARCHAR(100), @Model_ID INT, @Version_ID INT, @VersionStatus_ID INT, @VersionStatus_Committed INT = 3, @Entity_ID INT, @MemberCount INT = 0, @ErrorCount INT = 0, @NewBatch_ID INT = 0, @GetNewBatch_ID INT = 0, @CurrentHierarchy_ID INT, --@User_ID INT = 0, -- The user ID used for logging is 0.
btw, can't you use sp : udpStagingBatchSave and specify the userid anyway ?
example here : http://guldmann.wordpress.com/2010/11/30/batching-data-into-master-data-services/
Regards,
Xavier Averbouch
Microsoft Community Contributor
SOAT
If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful".- Bearbeitet Xavier Averbouch [xavave]Moderator Montag, 4. Februar 2013 08:25
- Als Antwort markiert Biz_mm Montag, 11. Februar 2013 07:30
-
Montag, 11. Februar 2013 07:39
Hi Xavier
I have just "promoted" the UserId to "in" parameters and made a copy of the stg. procdure as you suggest...but it is a rather ugly solution? (works fine anyway)
udpStagingBatchSave is for the old depricated batch process (maybe i will test later)?
Xavier, if i wrote a C# component to make changes to the model instead, i would not have that problem (setting the EnterUsername, LastChgUsername) right?
/Mm
MM
-
Montag, 11. Februar 2013 09:57Moderator
Hi MM
yes, I think that making changes to the model would be a more stable solution.
Regards,
Xavier Averbouch
Microsoft Community Contributor
SOAT
If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful".- Als Antwort markiert Biz_mm Montag, 11. Februar 2013 15:09

