CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)
EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'
SELECT TableName, RowCnt FROM #temp ORDER BY RowCnt desc
DROP TABLE #temp
获取系统当前时间:
getdate()
修改表结构:
ALTER TABLE Person ALTER COLUMN age INT NULL
ALTER TABLE Person ALTER COLUMN sex INT NULL