Поделиться через


Свойство ScriptingOptions.TargetServerVersion

Gets or sets the version of the instance of SQL Server for which the generated script is intended.

Пространство имен:  Microsoft.SqlServer.Management.Smo
Сборка:  Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)

Синтаксис

'Декларация
Public Property TargetServerVersion As SqlServerVersion 
    Get 
    Set
'Применение
Dim instance As ScriptingOptions 
Dim value As SqlServerVersion 

value = instance.TargetServerVersion

instance.TargetServerVersion = value
public SqlServerVersion TargetServerVersion { get; set; }
public:
property SqlServerVersion TargetServerVersion {
    SqlServerVersion get ();
    void set (SqlServerVersion value);
}
member TargetServerVersion : SqlServerVersion with get, set
function get TargetServerVersion () : SqlServerVersion 
function set TargetServerVersion (value : SqlServerVersion)

Значение свойства

Тип: Microsoft.SqlServer.Management.Smo.SqlServerVersion
A SqlServerVersion object value that specifies the version of the instance of SQL Server.

Замечания

The default value of this property is Version80.

Примеры

The following code example specifies that the script owner will be listed in the generated script.

Visual Basic

Dim scOps As New ScriptingOptions()
scOps.TargetServerVersion = SqlServerVersion.Version100

PowerShell

$scOps = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions
$scOps.TargetServerVersion = [Microsoft.SqlServer.Management.Smo.SqlServerVersion]::Version100

См. также

Справочник

ScriptingOptions Класс

Пространство имен Microsoft.SqlServer.Management.Smo

Другие ресурсы

Создание скриптов