title: Deploy Visual Studio Database Project Objects to Schema other than "dbo"
body: <p>I have the following scenario.</p>
  
  <p>I've got a SQLCLR stored procedure in a Visual Studio database project. This should not be in the <code>dbo</code> schema but in <code>foo</code>. As I saw, it's not possible to give a different schema to a SQLCLR stored procedure when using the Visual Studio publish feature.</p>
  
  <p>So I have to wrap it. Now I have two scripts.</p>
  
  <p>One to add the assembly:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE ASSEMBLY [MyAssembly]
  FROM 'MyAssembly.dll';
  GO
  </code></pre>
  
  <p>And another to add the stored procedure to the database:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE PROCEDURE [foo].[MyProc](@param NVARCHAR(10))
      AS EXTERNAL NAME MyAssembly.ClassName.MyProc
  GO
  </code></pre>
  
  <p>But now I get an error due to an unresolved reference to <code>MyAssembly</code>. I think this is because it's all (SQLCLR proc, T-SQL wrapper proc, assembly add script) in the same project and it's a reference to itself.</p>
  
  <p>What might be the best way to deploy the SQLCLR stored procedure under my own Schema in the database? If it's possible to add this directly to the SQLCLR implementation would be great.</p>
  
  <p>Thanks in advance.</p>