Table.DateLastModified Property
Applies To: SQL Server 2016 Preview
Gets the date and time when the table was last modified.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
Syntax
[SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase | SfcPropertyFlags.Matrix)]
public DateTime DateLastModified { get; }
public:
[SfcPropertyAttribute(SfcPropertyFlags::None | SfcPropertyFlags::Standalone | SfcPropertyFlags::SqlAzureDatabase | SfcPropertyFlags::Matrix)]
property DateTime DateLastModified {
DateTime get();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase | SfcPropertyFlags.Matrix)>]
member DateLastModified : DateTime with get
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Matrix)>
Public ReadOnly Property DateLastModified As Date
Property Value
Type: System.DateTime
A DateTime system object value that specifies the time and date when the table was last modified.
Examples
Legacy Code Example
The following code example shows how to create a new table and display the time and date that it was last modified on the console.
C#
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];
Table tb = new Table(db, "Test Table");
Column col1 = new Column(tb, "Name", DataType.NChar(50));
Column col2 = new Column(tb, "ID", DataType.Int);
tb.Columns.Add(col1);
tb.Columns.Add(col2);
tb.Create();
Console.WriteLine("The table was last modified on " + tb.DateLastModified.ToString());
Powershell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2012")
#Create the Table
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "Test Table")
$col1 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "Name", [Microsoft.SqlServer.Management.Smo.DataType]::NChar(50))
$col2 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "ID", [Microsoft.SqlServer.Management.Smo.DataType]::Int)
$tb.Columns.Add($col1)
$tb.Columns.Add($col2)
$tb.Create()
Write-Host "The table was last modified on" $tb.DateLastModified
See Also
Table Class
Microsoft.SqlServer.Management.Smo Namespace
CREATE TABLE (Transact-SQL)
Unable to find linked topic '811e00f9-303f-42b5-8bd4-2cdb829c84e9'.
Return to top