Access to the code in the CLR Stored Procedures

  • Hi everybody,

    I'm a DBA for a Company database; and of course a sysadmin. We have few CLR stored procedures embedded into SQL Server from .NET application.

    The modify option is greyed out and the script returns just the name of stored proc and it's parameters.

    Is there any way I can view and search inside the entire code in these CLR's within the SSMS?

    Your reply is very much appreciated.

  • No, you would need access to the source code repository that was used to build the assembly.

  • It is very frustrating though; since I'm a SQL DB and have no control over these objects in SQL Server.

    Did anybody have any luck with other approaches?

    Any recommendation if anything I can do about it would be greatly appreciated.

  • As a matter of policy CLR object source code must be submitted to me prior to deployment. With sufficient lead time to review it. And I have access to the source control system.

    Depending on how it was deployed a copy of the source files may have been deployed into the extended properties for the assembly. But this is not for certain and I would not count on it.

    Unfortunately SQLCLR is a blackbox from SQL's perspective. So you have to be proactive.

    You could probably read the bytes out of the system tables and run them against a decompiler but it wouldn't be pretty.

    CEWII

  • You can try this: http://ask.sqlservercentral.com/questions/71956/getting-the-source-code-from-a-clr-assembly

    The compiled code is stored in the system tables. Decompiling it can be tricky. .NET Reflector from Red Gate may help, or another decompiler, but it may or may not be 100%. You'd need to recompile and test to see if it works correctly.

    Disclosure: I work for Red Gate

  • Thanks a lot for your responds guys,

    Steve I will definitely try a .NET Reflector approach from RedGate and let you know how it went.

    Thanks again for all your help and cooperation.

    Alex

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply