Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sathish133
Helper I
Helper I

Microsoft Fabric - Synapse Warehouse - DDL Script Generation

Hi Team,

 

Once we create a table in the Database, then we can able to DESCRIBE the table in the query window using DESC command or we can generate the CREATE SQL or get the table DDL script from Metadata tables for already created tables in the database.

 

Sameway I am trying to get the DDL script, But not able to find the option in Microsoft Fabric Warehouse.

DESC --> not working in Fabric Warehouse
Tried below SQL, but not getting the expected DDL for the table

SELECT sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
WHERE o.name = 'TableName';


Can you suggest the option if anything available in Microsoft Fabric Warehouse.

Regards,

Sathish Kumar Mathivanan

 

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Sathish133,

AFAIK, the DESCRIBE current only work when you use notebook to operate with lakehouse delta table. For data warehouse tables, they seems not able to used with DESCRIBE commands. 

Perhaps you can try to move this to the lakehouse and use notebook with these commands.

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

We can't move the solution to Lakehouse. 

Other than DESCRIBE, Do we have any other option like any metadata tables contains the DDL ?

 

Regards,

Sathish Kumar Mathivanan

Hi @Sathish133,

I'd like to suggest you use query to list the views under the schema: INFORMATION_SCHEMA.TABLES/INFORMATION_SCHEMA.COLUMNS, they should include the metadata fields that you wanted.

Notice: you query records from these schema but currently you not have permission to view and query data from some sys table/views.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @Sathish133 ,

Any update on this? Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.