Hi,
I am trying to figure out what the exact T-SQL are when running the DB
Maint. Plan
I know SQL Server use DBCC CheckDB, DBCC DBReindex,
but what code it uses for Truncate the space when the file (Data and Log)
size > 50MB in the Maintenance Plan?
Are they using sp_spaceused and then DBCC ShrinkDatabase?
Thanks for any answer
EdYou can use Profiler to find out what is being executed.
It seems that it is something like this:
use [TestDatabase]
go
select ceiling((sum(size) * (8192.0/1024.0)) / 1024.0) from
dbo.sysfiles
go
DBCC shrinkdatabase(N'TestDatabase', 10, TRUNCATEONLY )
go
exec sp_spaceused
go
DBCC SQLPERF(LOGSPACE)
go
Razvan
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment