Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 list sql server reports

Author  Topic 

fqiao70
Yak Posting Veteran

52 Posts

Posted - 2009-02-13 : 13:39:41
Hi Experts,
we have about 10 sql servers and each sql server has about 20 databases. i want to create a table that list all sql servers, databases, and application name, size. also i want that table got automaticly updated once a week for databases name/size changes. so i can generate a report base on that table every week. how could i do that? i know how to generate a report for each server using this code, but i don't know how to fetch them to that table? Thanks a lot

CREATE TABLE #server_databases (
DATABASE_NAME nvarchar(200),
DATABASE_SIZE int,
REMARKS nvarchar(200))

INSERT INTO #server_databases EXEC sp_databases

SELECT DATABASE_NAME,DATABASE_SIZE/1024 "DATABASE_SIZE(M)" FROM #server_databases

DROP TABLE #server_databases

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-13 : 13:50:39
Moved the thread out of the "Script Library" forum since this is not a working solution.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -