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 2000 Forums
 Transact-SQL (2000)
 Need help with a server audit script to track db's

Author  Topic 

rmartin
Starting Member

1 Post

Posted - 2005-02-18 : 12:39:50
Hi Everyone, I could use some help. I support several development servers running MS SQL 2000. I'm are trying to create a script that will give us the output of SP_SPACEUSED and:

USE master
GO
SELECT name,filename
FROM sysdatabases


as a single report for all the databases on a server and if possible, an DB access audit.
I'm currently using this script to audit the database access:

SELECT name AS 'User_Name',status,roles AS DB_Role
FROM sysusers
WHERE hasdbaccess >= 1


I then paste the output of each database into an excel spreadsheet so I can see all the databases in one report. I really want to automate this though. Any help would be appreciated. If we can get this working I will post the final script for everyone to use as a SQL Agent job.

Thanks

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-02-21 : 05:46:49
You may be able to use DTS to do this (or perhaps BCP)

steve

And how is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain.
Go to Top of Page
   

- Advertisement -