August 13, 2003 at 2:36 am
I need to capture when a new database is created in a SQL 2000 instance.
The logical thing to do would be to put an insert trigger on sysdatabases, but it is not possible to put a trigger on a system table (or a view referencing a system table).
The solution I have arrived at is to create a table containing a copy of all the spid's from sysdatabases and compare this to sysdatabases via a scheduled job every hour or so to see if any new ones have appeared.
Anyone got any better ideas?
August 13, 2003 at 5:08 am
What about the crdate
Select * from Master..SysDatabases
Where CRDate>=DateAdd(d,-1,GetDate())
August 27, 2003 at 4:52 am
That works very nicely thank you.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy