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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
selsoft1907
New Member

Generate some views create script

I have a Fabric Data Warehouse. I want to export some views create script into a SQL file. Basically generate script operation. Is it possible ? 
This type of scripts is not working:
SELECT
s.name AS schema_name,
v.name AS view_name,
m.definition
FROM sys.views v
INNER JOIN sys.sql_modules m ON v.object_id = m.object_id
INNER JOIN sys.schemas s ON v.schema_id = s.schema_id
where v.name like '%TEST'
ORDER BY s.name, v.name;

2 ACCEPTED SOLUTIONS
smeetsh
Responsive Resident
Responsive Resident

I ran the script (without the where and order by clause) and that works just fine in SSMS and the fabric UI.

 

The '%TEST' may be invalid. Try running it without the where and see what the results are? PS Keep in mind it is case sensitive.

smeetsh_0-1753159188604.png

 

What is it exactly what you are trying to achieve?

 

Cheers

Hans

Cheers

Hans

(If my solution was usefull, please give it a kudo, and mark it as a solution)

View solution in original post

v-dineshya
Community Support
Community Support

Hi @selsoft1907 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @smeetsh  Thank you for your prompt response.

 

Hi @selsoft1907 , As mentioned by @smeetsh , please provide more details about your issue and what you are trying to achieve.

 

Regards,

Dinesh

View solution in original post

3 REPLIES 3
v-dineshya
Community Support
Community Support

Hi @selsoft1907 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @smeetsh  Thank you for your prompt response.

 

Hi @selsoft1907 , As mentioned by @smeetsh , please provide more details about your issue and what you are trying to achieve.

 

Regards,

Dinesh

smeetsh
Responsive Resident
Responsive Resident

I ran the script (without the where and order by clause) and that works just fine in SSMS and the fabric UI.

 

The '%TEST' may be invalid. Try running it without the where and see what the results are? PS Keep in mind it is case sensitive.

smeetsh_0-1753159188604.png

 

What is it exactly what you are trying to achieve?

 

Cheers

Hans

Cheers

Hans

(If my solution was usefull, please give it a kudo, and mark it as a solution)

I fix the issue. The reason behind ssms. When I run this script it return space for view definition column. However when I run under fabric portal it returns data. Maybe reason is permissions.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.