Forum Discussion

BiJoe's avatar
BiJoe
Icon for Helper II rankHelper II
2 years ago

[Database Projects] Statement 'CREATE TABLE' is not supported

I have just started testing Database Projects extension in Azure Data Studio. I have made a new project out of an existing Fabric warehouse. In that warehouse I have several stored procedure which are triggered in a pipeline, for dropping, creating and transforming tables. 

 

The project seemingly loads just fine in ADS, I can run select queries locally and get expected results, as well as ALTER existing procedures. 

 

For testing I made some simple changes in one of the stored procedures in ADS, then chose Build. I get a lot of errors, the first one is

 

 

Build error SQL70015: Statement 'CREATE TABLE' is not supported for the targeted platform.

 

 

 I seem to remember this being a problem earlier in Fabric warehouses, but CREATE TABLE works just fine in Fabric portal now. What am I doing wrong?

 

EDIT: I just made a new folder for containing all Database Projects, and created yet another new project from the same existing Fabric warehouse. I see that the changes I made in the failed build is also implemented in the stored procedure from the new project...

7 Replies

  • AndyDDC's avatar
    AndyDDC
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hi BiJoe so to clarify, it's not any CREATE TABLE syntax failing for actual tables in your database project, but rather CREATE TABLE syntax within Stored Procedures in your database project?

    • BiJoe's avatar
      BiJoe
      Icon for Helper II rankHelper II

      AndyDDC there are two issues here: 

       

      1. The stored procedures I wrote had CREATE TABLE AS, which I can work around by using SELECT INTO

      2. All the tables, both the ones created from my SP, and the tables imported with Data Flow, show up as CREATE TABLE statements. 

       

      Each of these CREATE TABLE AS statements generate a build failure. I have submitted a support ticket for this. I guess the reason for this failure is that Microsoft SQL Server does not allow CREATE TABLE AS?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi BiJoe 
        Can you please provide the support ticket number here? This would help us to track internally.

        While SQL Server itself supports CTAS, Azure Data Studio Database Projects might have limitations regarding specific platforms like Fabric warehouses. The build error message "SQL70015: Statement 'CREATE TABLE' is not supported for the targeted platform" accurately reflects the current incompatibility.