Open immsgbb opened 3 years ago
What type is $scrp
Is it a Scripter
?
You should probably use EnumScript
instead of Script
, as it returns an IEnumerable<string>
instead of a StringCollection
. Also, both methods take arrays as input so you probably need to use Linq or some other way to convert the collection to an array so the reflection code in powershell can pick the right method.
$scrp = new-object ('Microsoft.SqlServer.Management.Smo.Scripter') ($s)
I am trying to script the Synapse SQL Serverless objects and mainly External Sources objects. Which mainly consist of External File Format and External Data Sources.
Is it possible ?
$scrp.Script($dbs["stg"].ExternalDataSources) Multiple ambiguous overloads found for "Script" and the argument count: "1". At line:1 char:1
script function doesn't work with external data source. Is there another way to script it ?