Friday, March 23, 2012

How to Enable CLR Integration in SQL Server Express and Create SQLCLR Project in VB 2005 Express

Hi all,

In my SQL Server Express (that is installed in my Windows XP Pro PC), SQL Server 2005 Network Configuration has Protocols for SQLEXPRESS. I tried to do "Enabling CLR Integration" in my SQL Server Express: (1) If I clicked on "Surface Area Configuration for Services and Connections", I got an error "An exception occurred in SMO while trying to manage a service, (Microsoft.SqlServer.Smo) Additional information: Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) The operation could not be completed. (WinMgmt). (2) If I clicked on "Surface Area Configuration for Features, I got a different error "Computer localhost does not exist on the network, or the computer cannot be configured remotely. Verify that the remote computer has the required computer has the required Windows Management Instrumentation components and then try again. (SQLSAC) Additional Information: An exception occurred in SMO while trying to manage a service. (Microsoft.SqlServer.Smo). Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) The operation could not be completed. (WinMgmt). Please help and tell me how I should do to get "Enabling CLR Integration" in my SQL Server Express done and how I can create SQLCLR Project in VB 2005 Express.

Thanks in advance,

Scott Chang

Normally you would enable the CLR using the Surface Area Configuration Tool, but it appears that something is wrong with SMO on your computer. I don't know much about how to fix SMO and SAC, so you should ask some questions about how to get these tools working over in the General Tools forum. Having SMO broken will impact other tools that you might want to use, so this is relatively important.

In the mean time, you can configure CLR manually using TSQL by running the following query in management studio or using SQLCmd:

Code Snippet

sp_configure 'clr enabled', 1

RECONFIGURE

Check out the topic on server configuration in BOL for more informaiton.

Mike

|||

I think the SMO problem is related to a WMI problem on your machine, it would be interesting if you could post the error messages to see if the message correlate with the assumptions that this is based on the WMI part of SMO.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Hi Jens and Mike, Thanks for your responses.

I guess my SQL Express 9.0.1399 is too old to get the CLR Integration. I am thinking to delete this 2-year old SQL Express in my PC and download and install the Microsoft Advanced SQL Erxpress (with some SP) for "Enabling CLR Integration". Is it a right thing for me to do? Please respond.

Thanks,

Scott Chang

|||

Hi Scott,

I'm curious as to how you've come to this conclusion? Did you try running the command I suggested to enable the CLR?

All versions of SQL Express 2005, including the one you list, support integrated CLR. The T-SQL command I suggested should enable the CLR. I believe it is a best practice to always run the latest service pack, which is SP2 right now, but the SP-level has nothing to do with CLR support.

If Jen's suggestion about a WMI configuration problem causing your issues with SAC, upgrading or re-installing will not fix that problem either since WMI is a Windows component. If it's not configured correctly on your computer, SQL can't do anything about it, you have to fix WMI. I would suggest posting the error you are getting as Jen's suggested to see if ayone has heard of your specific message.

Mike

|||

Hi Mike and Jens, Thank you both for your responses.

I have tried to understand what you said for 10 days. I thought I already presented the error messages in my first posting. Sorry, I am new in WMI, SMO and CLRSAC and I am completely lost now. I want to tell you that my SQL Server Express is in my personal PC that is a stand-alone Windows XP Pro PC without any Network/LAN system. I think I did not know how to configure my SQL Server Express correctly when I installed it 2 years ago. Please tell me how I can get the specific error messages Jens asked for.

Thanks again,

Scott Chang

|||

Hi Scott,

First, I want to make sure that you understand tha WMI is not part of SQL Server, it is a Windows component that many different systems rely on and use. As I said, it seems that you are getting SMO errors when you try to run the Surface Area Configuration Tool; you should probably go and post this question in the General Tools forum as that is the group that deals with SAC.

If the problem is really related to WMI, it could be that your WMI Repository is corrupt, and you could try rebuilding it. When you start messing with the sub-systems of Windows, it's always possible that you could make things worse if you do stuff wrong. If you're concerned about this, you should look for help from the right sources, General Tools for SAC and the Windows Group for help with WMI.

If you're bold, you could give the repository rebuild a try, one set of instructions is posted at http://www.nucleustechnologies.com/Repair-WMI-Services.php.

Mike

No comments:

Post a Comment