<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Cannot install assembly on SQL Server 2008 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831177#M4862020</link>
    <description>&lt;P&gt;This is probably closer to a Microsoft SQL Server question than a SQL Anywhere question, so you may want to check out other Microsoft SQL Server resources for further assistance.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;The deployment requirements for the SQL Anywhere ADO.NET assembly are noted in the &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbprogramming/deploying-adonet-deploy.html"&gt;documentation&lt;/A&gt; - ensuring that the native DLLs can be located via the SQL Server's PATH environment variable is likely the most important point for deploying the unmanaged DLLs.&lt;/P&gt;
&lt;P&gt;There is a &lt;A href="http://stackoverflow.com/questions/2781624/sqlclr-using-the-wrong-version-of-the-net-framework"&gt;stackoverflow question&lt;/A&gt; that seems to suggest this might be due to a mismatch of CLR versions. It seems that there's an open question of which CLR version currently runs on SQL Server, depending on environment configuration - to determine your current configuration, you will need to run the SQL:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;select * from sys.dm_clr_properties&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Perhaps you need to load the 4.0 CLR ADO.NET provider (&lt;CODE&gt;iAnywhere.Data.SQLAnywhere.v4.0.dll&lt;/CODE&gt;) to match the 4.0 CLR version loaded in Microsoft SQL Server...? &lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2013 11:25:12 GMT</pubDate>
    <dc:creator>jeff_albion</dc:creator>
    <dc:date>2013-12-19T11:25:12Z</dc:date>
    <item>
      <title>Cannot install assembly on SQL Server 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaq-p/13831175</link>
      <description>&lt;P&gt;made some library and want to use it as CLR assembly in MSSQL. The point is that my lib have the reference to 'iAnywhere.Data.SQLAnywhere' lib which I cannot install. The error is:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Assembly 'iAnywhere.Data.SQLAnywhere'
could not be installed because
existing policy would keep it from
being used.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have implemented the recommendations and now my SQL looks like:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;USE DB_Control&lt;/CODE&gt;
    GO &lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;ALTER&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DATABASE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DB_Control&lt;/SPAN&gt; &lt;SPAN class="n"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TRUSTWORTHY&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="n"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ROLLBACK&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IMMEDIATE&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;ALTER&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DATABASE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DB_Control&lt;/SPAN&gt; &lt;SPAN class="n"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TRUSTWORTHY&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ON&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="nb"&gt;exec&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sp_configure&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'show advanced options'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;RECONFIGURE&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="nb"&gt;exec&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sp_configure&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'clr enabled'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;RECONFIGURE&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;IF&lt;/SPAN&gt; &lt;SPAN class="n"&gt;EXISTS&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sys&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;assemblies&lt;/SPAN&gt; &lt;SPAN class="n"&gt;a&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;a&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;name&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'ClrSqlMediator'&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;EXEC&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sp_executesql&lt;/SPAN&gt; &lt;SPAN class="n"&gt;N&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'DROP ASSEMBLY ClrSqlMediator'&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ASSEMBLY&lt;/SPAN&gt; &lt;SPAN class="p"&gt;[&lt;/SPAN&gt;&lt;SPAN class="n"&gt;iAnywhere&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SQLAnywhere&lt;/SPAN&gt;&lt;SPAN class="p"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;AUTHORIZATION&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sa&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'~\\Debug\\iAnywhere.Data.SQLAnywhere.dll'&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="n"&gt;PERMISSION_SET&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;UNSAFE&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ASSEMBLY&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ClrSqlMediator&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;AUTHORIZATION&lt;/SPAN&gt; &lt;SPAN class="n"&gt;sa&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'~\\Debug\\SQLMediator.dll'&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="n"&gt;PERMISSION_SET&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;UNSAFE&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;GO&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does anybody know how to fix this?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2013 05:55:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaq-p/13831175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-19T05:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot install assembly on SQL Server 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831176#M4862019</link>
      <description>&lt;P&gt;Maybe this is the obstacle: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework\\OnlyUseLatestCLR is it set to 1?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2013 08:06:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831176#M4862019</guid>
      <dc:creator>MCMartin</dc:creator>
      <dc:date>2013-12-19T08:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot install assembly on SQL Server 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831179#M4862022</link>
      <description>&lt;P&gt;nope, that doesn't help. Same error&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2013 09:20:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831179#M4862022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-12-19T09:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot install assembly on SQL Server 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831177#M4862020</link>
      <description>&lt;P&gt;This is probably closer to a Microsoft SQL Server question than a SQL Anywhere question, so you may want to check out other Microsoft SQL Server resources for further assistance.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;The deployment requirements for the SQL Anywhere ADO.NET assembly are noted in the &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbprogramming/deploying-adonet-deploy.html"&gt;documentation&lt;/A&gt; - ensuring that the native DLLs can be located via the SQL Server's PATH environment variable is likely the most important point for deploying the unmanaged DLLs.&lt;/P&gt;
&lt;P&gt;There is a &lt;A href="http://stackoverflow.com/questions/2781624/sqlclr-using-the-wrong-version-of-the-net-framework"&gt;stackoverflow question&lt;/A&gt; that seems to suggest this might be due to a mismatch of CLR versions. It seems that there's an open question of which CLR version currently runs on SQL Server, depending on environment configuration - to determine your current configuration, you will need to run the SQL:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;select * from sys.dm_clr_properties&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Perhaps you need to load the 4.0 CLR ADO.NET provider (&lt;CODE&gt;iAnywhere.Data.SQLAnywhere.v4.0.dll&lt;/CODE&gt;) to match the 4.0 CLR version loaded in Microsoft SQL Server...? &lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2013 11:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831177#M4862020</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2013-12-19T11:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot install assembly on SQL Server 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831178#M4862021</link>
      <description>&lt;P&gt;I am no expert on SQL Server but the message you quoted mentioned "policy".  There is a policy file that accompanies easch release of the provider that indicates that the new version can satisfy earlier versions. Perhaps your "Debug" version is too new or too old.&lt;/P&gt;
&lt;P&gt;I'd try running "setupvspackage /ua" in the SQL Anywhere Assembly\\V2 folder from an admin command prompt and then "setupvspackage /i". Repeat for Assembly\\V4. Then make sure that the provider referenced in your "FROM" clause is that same version. &lt;/P&gt;
&lt;P&gt;This might help. &lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2013 09:23:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-install-assembly-on-sql-server-2008/qaa-p/13831178#M4862021</guid>
      <dc:creator>jack_schueler</dc:creator>
      <dc:date>2013-12-20T09:23:51Z</dc:date>
    </item>
  </channel>
</rss>

