DataFile.IsPrimaryFile Property
Applies To: SQL Server 2016 Preview
Gets the Boolean property value that specifies whether the data file is the primary file of the database.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
Syntax
[SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.ReadOnlyAfterCreation | SfcPropertyFlags.Standalone | SfcPropertyFlags.Matrix)]
public bool IsPrimaryFile { get; set; }
public:
[SfcPropertyAttribute(SfcPropertyFlags::None | SfcPropertyFlags::ReadOnlyAfterCreation | SfcPropertyFlags::Standalone | SfcPropertyFlags::Matrix)]
property bool IsPrimaryFile {
bool get();
void set(bool value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.ReadOnlyAfterCreation | SfcPropertyFlags.Standalone | SfcPropertyFlags.Matrix)>]
member IsPrimaryFile : bool with get, set
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.Matrix)>
Public Property IsPrimaryFile As Boolean
Property Value
Type: System.Boolean
A Boolean value that specifies whether the data file is the primary file or a secondary file.
If True, the data file the primary file. Otherwise, False (default).
Remarks
The primary file has an .mdf file extension and secondary files have an .ndf file extension.
Examples
Legacy Code Example
Using Filegroups and Files to Store Data
See Also
DataFile Class
Microsoft.SqlServer.Management.Smo Namespace
CREATE DATABASE (SQL Server Transact-SQL)
Unable to find linked topic '39e00ebe-c9b7-4d53-90bd-15de2015fd34'.
Return to top