1

I recently created an external data source and a few external data tables to query between Azure SQL Databases. This works successfully and I have used the results in PowerBI.

I then attempted to pull the objects into my data project in Visual Studio 2019 v16.4.2 using schema compare, which successfully recognized the objects and brought them into the project. However, all of the new objects list the classic "SQL46010: Incorrect Syntax near CREATE" error, as if the build isn't even aware of what it needs to do with the objects.

Here's what I have done to to troubleshoot

  • I checked to make sure that my project was correctly set as Azure SQL Database
  • I added in the Master Key create statement and the Data Source Credentials objects to see if those would "help" the situation at all. It turns out those object also would not build.
  • I attempted to move the external tables to take no action on a build, but this was a foolish action, since that meant the views referencing the tables could no longer build.
  • I had a friend try this to see if something was messed up with my Visual Studio, he had the same errors.
  • I spent an unreasonable amount of time googling.

Anyway, here is some example code to show the Syntax that I'm trying to use. Please if anyone has any idea what the problem might be, let me know.

CREATE EXTERNAL DATA SOURCE [MyDBNameDBQueryDataSrc]
    WITH (
    TYPE = RDBMS,
    LOCATION = N'MyAzureSQLServer.database.windows.net',
    DATABASE_NAME = N'MyAzureSQLDatabaseName',
    CREDENTIAL = [MyCredentialDBQueryCred]
    );
CREATE EXTERNAL TABLE [schema].[MyTable] (
    [IdColumn] NVARCHAR (255) NULL,
    [Column1] NVARCHAR (255) NULL,
    [Column2] NVARCHAR (255) NULL,
    [Column3] NVARCHAR (255) NULL
)
    WITH (
    DATA_SOURCE = [MyDBNameDBQueryDataSrc]
    );

0 Answers0