Anthony
Anthony

Reputation: 37065

Table valued function only returns CLR error

I have read-only access to a database that was set up for a third-party, closed-source app. Once group of (hopefully) useful table functions only returns the error:

Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131522. You need to restart SQL server to use CLR integration features. (severity 16)

But in theory, the third-party app should be able to use the function (either directly or indirectly), so I'm convinced I'm not setting things up right.

I'm very new to SQL Server, so I could be missing something obvious. Or I could be missing something really slight, I have no idea.

Here is an example of a query that returns the above error:

SELECT * FROM 
dbo.UncompressDataDateRange(4,'Apr 24 2010 12:00AM','Apr 30 2010 12:00AM')

Where the function takes three parameters:

  1. The Data Set (int) -- basically the data has 6 classifications, and the giant table this should be pulling from has a column to indicate which is which.

  2. startDate (smalldatetime)

  3. endDate (smalldatetime)

There are other, similar functions that expand on the same idea, all returning the same error.

Quick Note:

I'm not sure if this is relevant, but I was able to connect to the database via SQL Studio (but without the privs to script the functions as code), and a checked the dependency for the above sample function. It turns out that it is a dependent of a view that I have gotten to work, and that view is dependent of the larger, much-hairier data-table.

This makes me think I should somehow be pointing the function at the results of the view, but I'm not seeing any documentation that shows how that is done.

Upvotes: 1

Views: 670

Answers (1)

Andomar
Andomar

Reputation: 238276

The error message appears to hint that:

You need to restart SQL server to use CLR integration features

Perhaps the 3rd party installer enabled CLR integration, but was not able to restart SQL Server.

Upvotes: 1

Related Questions