我继承了以下管理查询,并在完全了解它返回的内容的情况下不时运行它:
--Loop until the Cursor was not able to fetch
WHILE (@@Fetch_Status >= 0)
BEGIN
--Dump the results of the sp_spaceused query to the temp table
INSERT #TempTable
EXEC sp_spaceused @TableName
--Get the next table name
FETCH NEXT FROM tableCursor INTO @TableName
END
--get rid of the Cursor
CLOSE tableCursor
DEALLOCATE tableCursor
--Select TABLE properties with SIZE -- Final step
SELECT name,
convert(date,create_date) as CreateDate,
convert(date,modify_date) as ModifyDate,
numberofRows,
dataSize
FROM sys.objects
join #temptable tm on
tm.tablename = sys.objects.name
WHERE type in ('U')
order by modify_date
GO
以下字段是什么?:
- “create_date” ...我猜什么时候运行“CREATE TABLE ...”
- "modify_date" ...这是上次更改表模式的时间吗?
他们中的任何一个是否告诉我数据最后一次进入DELETED
或INSERTED
进入表格?
如果没有,那么我如何获得这些信息?