If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Listing 'new' databases

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-08, 07:05
andrew.thompson andrew.thompson is offline
Registered User
 
Join Date: Nov 2003
Location: Lancashire, UK
Posts: 2
Listing 'new' databases

I'm looking for a script / SQL Agent job I could schedule that will flag up when a 'new' database has been created on some of our servers. One of the applications we run can create these -- but I need to do some 'housekeeping' on these servers as they don't have much spare space.
Reply With Quote
  #2 (permalink)  
Old 12-02-08, 07:15
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 1,517
What about
Code:
select * 
from sysdatabases
where crdate > getdate() - 1
You will need to adjust the date calculation to your needs
Reply With Quote
  #3 (permalink)  
Old 12-02-08, 10:46
andrew.thompson andrew.thompson is offline
Registered User
 
Join Date: Nov 2003
Location: Lancashire, UK
Posts: 2
Thank you -- it works a treat !
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On