Required to access the view from different source database. I am using the Azure data studio with SQL Database project. First I've exported Source database into dacpac and in new project created the Database reference point to source dacpac.
CREATE VIEW [dbo].[v_activitypointer] AS
SELECT * FROM [$(dvdbname)].[dbo].[ap_partitioned];
GO
It's working with above statement using * all column and it's able to build and depoly the project successfully. Instead of all columns, I need few columns when I change to specify column it's failing with SQL71561: SqlComputed column error
CREATE VIEW [dbo].[v_activitypointer] AS
SELECT [ucode] FROM [$(dvdbname)].[dbo].[ap_partitioned];
GO
c:\dbt\cicdtest\v_activitypointer.sql(2,13,2,13):
Build error SQL71561: SqlView: [dbo].[v_activitypointer] has an unresolved reference to object [$(dvdbname)].[dbo].[ap_partitioned].[ucode]. [c:dbtcicdtestcicdtest.sqlproj]
c:dbtcicdtestv_activitypointer.sql(2,13,2,13):
Build error SQL71561: SqlComputedColumn: [dbo].[v_activitypointer].[ucode] has an unresolved reference to object [$(dvdbname]).[dbo].[ap_partitioned].[ucode]. [c:dbtcicdtestcicdtest.sqlproj]
stdout: 0 Warning(s)
stdout: 2 Error(s)
Here's .sqlproj file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build">
<Sdk Name="Microsoft.Build.Sql" Version="0.1.12-preview" />
<PropertyGroup>
<Name>cicdtest</Name>
<ProjectGuid>{25E6C2C6-1C07-4516-BDC0-06E5AF0DCE07}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlServerlessDatabaseSchemaProvider</DSP>
<ModelCollation>1033, CI</ModelCollation>
<VerificationExtract>false</VerificationExtract>
<VerifyExtendedTransactSQLObjectName>False</VerifyExtendedTransactSQLObjectName>
</PropertyGroup>
<ItemGroup>
<SqlCmdVariable Include="dvdbname">
<Value>$(SqlCmdVar__1)</Value>
<DefaultValue>dataverse_uunq6705</DefaultValue>
</SqlCmdVariable>
</ItemGroup>
<ItemGroup>
<ArtifactReference Include="..\dataverse_uunq6705.dacpac">
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
<DatabaseVariableLiteralValue>dataverse_uunq6705</DatabaseVariableLiteralValue>
</ArtifactReference>
</ItemGroup>
<Target Name="BeforeBuild">
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json" />
</Target>
</Project>
I tried turning off the VerificationExtract & VerifyExtendedTransactSQLObjectName but no use.