Scripter.Script Scripter.Script Scripter.Script Method

Definition

Generates Transact-SQL scripts that can be used to re-create a list of objects.

Overloads

Script(Urn[]) Script(Urn[]) Script(Urn[])

Creates a Transact-SQL script for a set of objects that are specified with an array of Urn objects.

Script(SqlSmoObject[]) Script(SqlSmoObject[]) Script(SqlSmoObject[])

Generates Transact-SQL scripts that can be used to re-create a list of objects.

Script(UrnCollection) Script(UrnCollection) Script(UrnCollection)

Creates a Transact-SQL script for a set of objects that are specified with a Urn object collection.

Script(Urn[]) Script(Urn[]) Script(Urn[])

Creates a Transact-SQL script for a set of objects that are specified with an array of Urn objects.

public:
 System::Collections::Specialized::StringCollection ^ Script(cli::array <Microsoft::SqlServer::Management::Sdk::Sfc::Urn ^> ^ urns);
public System.Collections.Specialized.StringCollection Script (Microsoft.SqlServer.Management.Sdk.Sfc.Urn[] urns);
Public Function Script (urns As Urn()) As StringCollection
Parameters
urns
Urn[]

An array of Urn object values that specify the list of objects to be scripted.

Returns

A StringCollection object value that specifies the Transact-SQL script for the list of objects.

Examples

Scripting

Remarks

This method throws an exception if it is invoked when the ScriptData property is set to True. This prevents the whole dataset from being scripted to a StringCollection object.

Script(SqlSmoObject[]) Script(SqlSmoObject[]) Script(SqlSmoObject[])

Generates Transact-SQL scripts that can be used to re-create a list of objects.

public:
 System::Collections::Specialized::StringCollection ^ Script(cli::array <Microsoft::SqlServer::Management::Smo::SqlSmoObject ^> ^ objects);
public System.Collections.Specialized.StringCollection Script (Microsoft.SqlServer.Management.Smo.SqlSmoObject[] objects);
Public Function Script (objects As SqlSmoObject()) As StringCollection
Parameters
objects
SqlSmoObject[]

A SqlSmoObject object array value that specifies the list of objects to be scripted.

Returns

A StringCollection object value that specifies the Transact-SQL scripts for the list of objects.

Examples

Scripting

Remarks

This method throws an exception if it is invoked when the ScriptData property is set to true. This prevents the entire dataset from being scripted to a StringCollection object.

Script(UrnCollection) Script(UrnCollection) Script(UrnCollection)

Creates a Transact-SQL script for a set of objects that are specified with a Urn object collection.

public:
 System::Collections::Specialized::StringCollection ^ Script(Microsoft::SqlServer::Management::Smo::UrnCollection ^ list);
public System.Collections.Specialized.StringCollection Script (Microsoft.SqlServer.Management.Smo.UrnCollection list);
Public Function Script (list As UrnCollection) As StringCollection
Parameters
list
UrnCollection UrnCollection UrnCollection

A UrnCollection object value that specifies the list of objects to be scripted.

Returns

A StringCollection object value that specifies the Transact-SQL script for the list of objects.

Examples

Scripting

Remarks

This method throws an exception if it is invoked when the ScriptData property is set to True. This prevents the entire dataset from being scripted to a StringCollection object.

Applies to