I have the following stored procedure:
CREATE PROCEDURE [db_FileSize] AS
SET NOCOUNT ON
PRINT '-------- Database Space Usage Report --------'
DECLARE database_cursor CURSOR FOR
SELECT [name]
FROM master..sysdatabases
--ORDER BY [name]
OPEN database_cursor
FETCH NEXT FROM database_cursor
BEGIN
PRINT ''
PRINT ''
FETCH NEXT FROM database_cursor
END
CLOSE database_cursor
DEALLOCATE database_cursor
When I run this with xp_sendmail or as a regular job and have it create an
output file is looks like this. Does anyone know a way I can format the
output?
Thanks,
-------- Database Space Usage Report --------
Database: master
name db_size
owner dbid created
status
----------------------------------------------- -------------
------------------------------------------------ ------ -----------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
------------------------------------------
master 10.94 MB
sa 1 Nov 13 1998
trunc. log on chkpt.
name
fileid
filename
filegroup
size
maxsize
growth usage
---------------------------------------------------------------------------
---
-----------------------------------------------------------------------
-----------------------------------------------------------------------
---------------------------------- ------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
------------------------------------------
------------------------------------
------------------------------------
------------------------------------ ---------
master
1
e:\MSSQL7db\data\master.mdf
PRIMARY
9920 KB
Unlimited
10% data only
mastlog
2
e:\MSSQL7db\data\mastlog.ldf
NULL
1280 KB
Unlimited
10% log only