Partager via


TSqlModel.AddOrUpdateObjects Method

Definition

Overloads

AddOrUpdateObjects(TSqlScript, String, TSqlObjectOptions)

Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSqlScript object plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.

AddOrUpdateObjects(String, String, TSqlObjectOptions)

Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSql Script string plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.

AddOrUpdateObjects(TSqlScript, String, TSqlObjectOptions)

Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSqlScript object plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.

public void AddOrUpdateObjects (Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript inputScript, string sourceName, Microsoft.SqlServer.Dac.Model.TSqlObjectOptions options);
member this.AddOrUpdateObjects : Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript * string * Microsoft.SqlServer.Dac.Model.TSqlObjectOptions -> unit
Public Sub AddOrUpdateObjects (inputScript As TSqlScript, sourceName As String, options As TSqlObjectOptions)

Parameters

inputScript
TSqlScript

Script containing TSql DDL statements

sourceName
String

A name to identify the inputScript, for example a fileName such as "MyTable.sql" or simply an alias like "dbo.Table". Scripts are cached and TSqlObjects are linked to the source name. Any future Update/Delete operations will remove all existing objects with the same script name and replace them with the new objects.

options
TSqlObjectOptions

Options defining how to interpret the script

Exceptions

If the supplied inputScript is null.

If the supplied sourceName is null or whitespace, or if it ends in ".xsd". Note: source names ending in ".xsd" are currently not supported. These relate to Xml Schema Collections and adding of these is currently not supported in the public API.

If communication with the Microsoft.SqlServer.Dac.Model.TSqlObjectService fails.

Applies to

AddOrUpdateObjects(String, String, TSqlObjectOptions)

Adds or updates the objects defined for a specified sourceName with the objects defined in the inputScript. If any objects were previously added with the same sourceName these will be completely replaced The object definitions are based on the contents of a TSql Script string plus additional metadata defined by a TSqlObjectOptions object The script should consist of valid TSql DDL statements.

public void AddOrUpdateObjects (string inputScript, string sourceName, Microsoft.SqlServer.Dac.Model.TSqlObjectOptions options);
member this.AddOrUpdateObjects : string * string * Microsoft.SqlServer.Dac.Model.TSqlObjectOptions -> unit
Public Sub AddOrUpdateObjects (inputScript As String, sourceName As String, options As TSqlObjectOptions)

Parameters

inputScript
String

Script containing TSql DDL statements

sourceName
String

A name to identify the inputScript, for example a fileName such as "MyTable.sql" or simply an alias like "dbo.Table". Scripts are cached and TSqlObjects are linked to the source name. Any future Update/Delete operations will remove all existing objects with the same script name and replace them with the new objects.

options
TSqlObjectOptions

Options defining how to interpret the script

Exceptions

If the supplied inputScript is null.

If the supplied sourceName is null or whitespace, or if it ends in ".xsd". Note: source names ending in ".xsd" are currently not supported. These relate to Xml Schema Collections and adding of these is currently not supported in the public API.

If communication with the Microsoft.SqlServer.Dac.Model.TSqlObjectService fails.

Applies to