Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Access to the code in the CLR Stored Procedures Expand / Collapse
Author
Message
Posted Thursday, December 1, 2011 2:25 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 11, 2014 2:21 PM
Points: 517, Visits: 219
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.



Post #1215010
Posted Thursday, December 1, 2011 4:13 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Saturday, October 25, 2014 3:18 AM
Points: 3,108, Visits: 11,504
No, you would need access to the source code repository that was used to build the assembly.

Post #1215060
Posted Thursday, December 1, 2011 4:19 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 11, 2014 2:21 PM
Points: 517, Visits: 219
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.



Post #1215062
Posted Thursday, December 1, 2011 7:03 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, October 9, 2014 1:02 PM
Points: 6,032, Visits: 5,284
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
Post #1215091
Posted Friday, December 2, 2011 7:04 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 4:13 PM
Points: 31,214, Visits: 15,660
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







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1215326
Posted Friday, December 2, 2011 7:58 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 11, 2014 2:21 PM
Points: 517, Visits: 219
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



Post #1215372
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse