0

Can let me know how to remove views/tables from Azure Synapse Inbuilt SQL Serverless Pool.

Its easy enough to remove individual tables/views using following:

use [DatabaseName] 
GO 
drop EXTERNAL table schemaname.tablename

But I would to remove all the views/tables shown here:

enter image description here

Patterson
  • 1,927
  • 1
  • 19
  • 56

1 Answers1

2

Run the following T-SQL query which builds a dynamic SQL statement to drop all views:

declare @sql nvarchar(max) = (
select STRING_AGG('drop view ['+s.name+'].['+v.name+']; ','
')
from sys.views v
join sys.schemas s on s.schema_id = v.schema_id
where v.is_ms_shipped = 0
)

exec(@sql)
GregGalloway
  • 11,355
  • 3
  • 16
  • 47