简体   繁体   中英

Build error SQL46005: Expected FILESTREAM_ON but encountered object instead when trying to build a database project for Azure Synapse SQL pool

I am trying to build a database project with azure synapse sql pool as the target database but i get Build error SQL46005: Expected FILESTREAM_ON but encountered object instead error every time single.

I investigated as noticed there are couple procedures where I am using the data swapping approach to stage and load the data. Here is an example of the pattern;

CREATE PROC [schema].[some_proc] AS

-- Drop temp table if exists
if object_id(N'schema.t_dim_temp_table') is not null
drop table schema.t_dim_temp_table;

create table schema.t_dim_temp_table
with (   distribution = hash (somecol)
        ,clustered columnstore index
     )
as
select
*
,CURRENT_TIMESTAMP AS last_update_date
from stgschema.v_dim_stage

-- Rename and remove temp objects
rename object schema.t_dim_table       to t_dim_table_old;
rename object schema.t_dim_temp_table  to t_dim_table;
drop table schema.t_dim_table_old;

Any ideas about how to get around this error will be appreciated

not sure if that will solve your issue but the rename works without the schema in the "to" part:

  • rename object schema.t_dim_table to t_dim_table_old;
  • rename object schema.t_dim_temp_table to t_dim_table;

Best, Ingo

I got around this issue by wrapping it in an Exec function.

Exec('rename object schema.t_dim_table       to t_dim_table_old');
Exec('rename object schema.t_dim_temp_table  to t_dim_table');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM