Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:17:05+00:00 2026-06-02T17:17:05+00:00

I migrated Mining Structures from a 2008 server to a 2012 server. When I

  • 0

I migrated Mining Structures from a 2008 server to a 2012 server. When I try my CLR UDF (which is working fine on SQL server 2008) in a DMX query on the 2012 server, I am getting this error:

Exception has been thrown by the target of an invocation. Object reference not set to an instance of an object.

My original goal was to get the GetNodeDescription(…) method running. While debugging the problem, I could isolate the problem to this UDF which fails on my SQL server 2012

[SafeToPrepare(true)]
public static string test()
{
  return Context.CurrentMiningModel.Name;
}

My guess is that CurrentMiningModel is null because the following code works fine

[SafeToPrepare(true)]
public static string testUser()
{
 return Context.CurrentConnection.User.Name;
}

Any Idea on how to solve this?
Is somebody out there who can reproduce this?

Thanks.

Jan

UPDATE:
A contact at Microsoft confirmed this behaviour as desired due to a “Metadata-Refactoring” (whatever this means…). However, the website still pends to be updated appropiately.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:17:08+00:00Added an answer on June 2, 2026 at 5:17 pm

    This is not the ultimate answer but it’s a workaround to get Microsoft’s GetNodeDescription working (by explicitly providing the mining model):

    [SafeToPrepare(true)]  
    public static string GetNodeDescription(string MiningModel, string nodeUniqueName)  
    {  
      if (Context.ExecuteForPrepare)  
      {
        return string.Empty;  
      }  
      return Context.MiningModels[MiningModel].GetNodeFromUniqueName(nodeUniqueName).Descript‌​ion;  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have just 'migrated' an SQL Server 2005 database from DEVEL into TEST. Somehow
I migrated a cake website from one server to another, but in statics pages
I have migrated Project server from one server to another. I am able to
I've migrated an ASP.NET web application from Server 2003(x86) to a Windows 7(x64) machine.
I just right now migrated from C# to C++/CLR. First I was annoyed, that
Migrated an apps to Windows Azure - previous platform was windows server 2008 R2.
We migrated our old SSRS 2005 reports to 2008. Now, when we try to
i have just migrated from a single web server environment to a multiwebserver environment
We recently migrated our 32 bit web application to 2008 Server R2 64 bit
I migrated a SQL Server database (source) into a SQL Server Express database (destiny).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.