Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
I need script related to databases
I need script related to databases
Rate Topic
Display Mode
Topic Options
Author
Message
praveen.gln1
praveen.gln1
Posted Wednesday, September 08, 2010 11:23 PM
Grasshopper
Group: General Forum Members
Last Login: Friday, December 23, 2011 3:36 PM
Points: 12,
Visits: 71
Can any one help me here....
I need a script to find out the users and last usage of the database.
Here i know the query to get the details after restart of sqlserver.But i dont want this.
I need the last usage date and list of users on all databases in a instance before the restart of sqlserver?
Please help me...
Thanks in Advance....
GLNP
Post #982813
Adi Cohn-120898
Adi Cohn-120898
Posted Thursday, September 09, 2010 12:50 AM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 10:47 PM
Points: 2,023,
Visits: 4,948
As far as I know the serve doesn't store this information. You could have a trigger on LOGON, that will writes the login name, date and database name each time that someone logs on.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #982849
Lowell
Lowell
Posted Thursday, September 09, 2010 3:57 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 4:22 PM
Points: 11,789,
Visits: 28,063
i love logon traces, but for tracking/ accessing specific databases, i don't think it would work;, a logon trigger occurs before a user connects to a database...so in the trigger you wouldn't find a database reference;
you'd want to use a server side trace for DML i htink instead, so you can track/roll up info from the trace results.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #982937
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.