Currently this is not supported in the SSMS.
You can script external tables one by one as you wrote from the SSMS UI.
We do plan to provide support for this in the future.
You can use PowerShell to script multiple external tables.
Have a look at this blog post that we wrote for details.
Summary of the blog post:
Open PowerShell
Run: Install-Module dbatools
Generate a script that creates external tables
If you have created a set of external tables in Synapse SQL and you want to move their
definitions to another instance or keep creation script locally or in some source-
control system, you can easily create script that creates all external tables.
If you have installed the latest version of DbaTools you can use the following script to generate CREATE EXTERNAL TABLE scripts for a set of your tables:
$loginName = "<login>"
$synapseSqlName = "<sql endpoint name>"
$databaseName = "<database name>"
$login = Get-Credential -Message "Enter your SQL serverless password" -UserName $loginName
$script = Get-DbaDbTable -SqlInstance "$synapseSqlName.sql.azuresynapse.net" -Database $databaseName -SqlCredential $login | Export-DbaScript -Passthru | Out-String
$script -replace ' NULL', ''
You need to enter name of Synapse SQL serverless endpoint instead of (for example mysynapsesqlendpoint-ondemand), login name that you will use to connect to your Synapse SQL database instead of , and name of the database where your external tables are placed instead of .
Once you run this script, you will see the script that creates external tables in output window.
Export-DbaScript enables you to customize the script and export CREATE TABLE statements in some file, define encoding, omit schema, etc. You have many options that you can use to customize script generation.
In the example above I have used Get-DbaDbTable command to fetch all external tables from my database. You can also customize this command to get the tables from multiple databases or specify set of tables that you want to export.
Conclusion
DbaTools is very useful set of PowerShell commands that can enable you to automate administration tasks in your Synapse SQL databases. In this example you have seen hot to generate scripts that create and drop tables, but you can easily modify this script to create/drop users, databases, etc.