ScriptingOptions.FileName 属性

Gets or sets the name of the file to which the generated script is output.

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public Property FileName As String 
    Get 
    Set
用法
Dim instance As ScriptingOptions 
Dim value As String 

value = instance.FileName

instance.FileName = value
public string FileName { get; set; }
public:
property String^ FileName {
    String^ get ();
    void set (String^ value);
}
member FileName : string with get, set
function get FileName () : String 
function set FileName (value : String)

属性值

类型:System.String
A String value that specifies the name of the file to which the generated script is output.

示例

The following code example sets the name of the scripts output file.

Visual Basic

Dim scOps As New ScriptingOptions()
scOps.FileName = "C:\Program Files\Microsoft SQL Server\100\DTS\ForEachEnumerators\SampleFileName.sql"

PowerShell

$scOps = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions
$scOps.FileName = "C:\Program Files\Microsoft SQL Server\100\DTS\ForEachEnumerators\SampleFileName.sql"

请参阅

参考

ScriptingOptions 类

Microsoft.SqlServer.Management.Smo 命名空间

其他资源

脚本撰写