We recommend using Visual Studio 2017

ScriptingOptions.TargetServerVersion Property

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

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public SqlServerVersion TargetServerVersion { get; set; }

Property Value

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

Community Additions

ADD
Show: