I need to run a T-SQL query to show the size of the Datasbe and Log file size. The results will then be outputted to a text file.
I know how to do the latter part, but what is the query I would need to get the results.
This is the script I have run so far:
use database
insert into dbsize (name,[size MB],date)
select filename,(size),getdate()
from {databasename}.dbo.sysfiles
go
This does not give me the database size, as the database is 68gb, however this output gives me 82gb.
Where am I going wrong.
Thanks in advance
Jade
I know how to do the latter part, but what is the query I would need to get the results.
This is the script I have run so far:
use database
insert into dbsize (name,[size MB],date)
select filename,(size),getdate()
from {databasename}.dbo.sysfiles
go
This does not give me the database size, as the database is 68gb, however this output gives me 82gb.
Where am I going wrong.
Thanks in advance
Jade