Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

including database name in relation causes issue w/ SSDT #65

Open
dataders opened this issue Oct 14, 2021 · 1 comment
Open

including database name in relation causes issue w/ SSDT #65

dataders opened this issue Oct 14, 2021 · 1 comment

Comments

@dataders
Copy link
Collaborator

dataders commented Oct 14, 2021

this Stack Overflow question and this dbt Slack thread brings up the issue.

to reiterate here, using the full three-part name is not an issue with an Azure Synapse Dedicated SQL pool (ASDSP). However, when trying to use SQL Server Data Tools in conjunction with ASDSP, two users report an error and asked if database name can be dropped. TBD if this would cause an issue for existing dbt-synapse users

@baldwicc
Copy link
Contributor

+1 on disabling three-part names by default.

If a statement includes references to objects that don't exist, Synapse will respond with "USE is not supported on this platform" instead of a more developer-friendly error message telling you what object "does not exist or you don't have permission".

This hints that the query engine might be translating three-part database names into multiple USE statements, the failure of any of which triggers the error handling for USE not being a supported language element in Synapse DSP.

MS Docs ref: https://learn.microsoft.com/sql/t-sql/language-elements/use-transact-sql

The following override macros work around the issue (lifted from the SO question)

{% macro ref(model_name) %}
    {% do return(builtins.ref(model_name).include(database=false)) %}
{% endmacro %}

{% macro source(source_name, table_name) %}
    {% do return(builtins.source(source_name, table_name).include(database=false)) %}
{% endmacro %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants