I am trying to create stored procedures with different schemas using SQL Command Variables, however I cannot build the project due to the error:
SQL71501: Procedure: [$(SchemaName)].[pr_MySproc] has an unresolved reference to Schema [$(SchemaName)].
This is how I have my stored procedure written:
CREATE PROCEDURE [$(SchemaName)].[pr_MySproc]
@Param1 tinyint = 0,
@Param2 INT = 0
...
And then a series of publish profiles all containing variables similar to this:
<SqlCmdVariable Include="SchemaName">
<Value>SCHEMA1</Value>
</SqlCmdVariable>
Is what I'm trying to do even possible? Is there a way to specify the schema via SQL Command Variables?

