Forum Discussion

AJAJ's avatar
AJAJ
Helper IV
6 months ago
Solved

Script out all Fabric Datawarehouse objects

Hi there,

 

In SQL db, i could script out all the views, sps, tables using the below. 

 

 


I know in fabric datawarehouse this is not available. However is there a work-around where I could script out all the objects (even fabric data pipelines) which can act as back up scripts, or moved somewhere else and deployed completely on a new subscription. I mean i'm looking to have scripts as back up,  could save the whole code in a zip file, usb drive, oneline drive, etc and have it portable and moved into a new subscription if things have to be started from scratch under a new business entity name.

 

Thanks

 

 

  • Hi AJAJ 

     

    You will need Visual Studio Code with two extensions, both extensions are from Microsoft.

     

    1. SQL Server (mssql) 

    2. SQL Database Projects

     

    Once installed, go to SQL Server extension page from the left menu and add a new connection to your Fabric workspace. Select Browse Fabric to pick your Fabric SQL Data Warehouse or Database. When connected you should see all databases on the left in the Databases node. Right click on the Database you'd like to script and select Create Project from Database menu.  You'll be asked to select a folder. Select File Type when asked for folder structure and recommended options for everything else. 

     

    You will now have one file containing the script for all objects. 

     

5 Replies

  • tayloramy Got it. So its all via Github repo. Thanks. How about if i need to script out data from a bunch of small tables? Something like config table may with 100-200 records? and if there are 20-25 tables. Ofcourse i have to export one by one or if there is any script.

  • Hi AJAJ 

     

    You will need Visual Studio Code with two extensions, both extensions are from Microsoft.

     

    1. SQL Server (mssql) 

    2. SQL Database Projects

     

    Once installed, go to SQL Server extension page from the left menu and add a new connection to your Fabric workspace. Select Browse Fabric to pick your Fabric SQL Data Warehouse or Database. When connected you should see all databases on the left in the Databases node. Right click on the Database you'd like to script and select Create Project from Database menu.  You'll be asked to select a folder. Select File Type when asked for folder structure and recommended options for everything else. 

     

    You will now have one file containing the script for all objects. 

     

    • AJAJ's avatar
      AJAJ
      Helper IV

      Thanks deborshi_nag . Im using fabric warehouse and not SQL DB. Does the above work for fabric datalake and warehouse (not SQL db)?