I've added a simple reference to my SQL Server 2008 CLR project (hosted in VS2012).
If I compile naively, it throws this:
SQL06503: Assembly 'microsoft.sharepoint, version=14.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c.' was not found in the SQL catalog.
If I enable "Model Aware" and "Generate Sql Script" on the reference, it seems to want to pull in the entire assembly inline, in hexadecimal format to an SQL script, which (a) seems crazy and (b) predictably hits the SQL script size cap and fails.
If I try writing this in a script:
create assembly [microsoft.sharepoint, version=14.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c.]
from N'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.dll'
with permission_set = safe
then I get this (un-Googleable) error:
SQL70502: The assembly source is not valid. Only binary literals are allowed.
which also seems crazy, considering that the official documentation from Microsoft at http://msdn.microsoft.com/en-CA/library/ms189524(v=sql.105).aspx explicitly shows that I should be able to add a <client_assembly_specifier>
string.
How do I add this reference?