May 15, 2014 at 1:39 pm
i need to prepare a report that shows last user access on a particular database and the account that is a service account or user account , can any one help in extracting the data ?
May 15, 2014 at 1:44 pm
ramyours2003 (5/15/2014)
i need to prepare a report that shows last user access on a particular database and the account that is a service account or user account , can any one help in extracting the data ?
select * from sys.syslogins
You might also look into login auditing. http://msdn.microsoft.com/en-us/library/ms175850.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 15, 2014 at 1:50 pm
thanks for providing the query i need to know what is status 9 mean when i execute the query?
May 15, 2014 at 2:00 pm
ramyours2003 (5/15/2014)
thanks for providing the query i need to know what is status 9 mean when i execute the query?
Are you familiar with BOL (Books Online)? It is the documentation that comes with SQL Server. You can access it by hitting F1 from within SSMS. You can also find it by using Binoogle or whatever search engine you prefer.
Try typing in "sys.syslogins" and click the first link in the result.
Often times you can find these kind of answers with minimal effort if you use a search engine.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 15, 2014 at 2:09 pm
is the information provided by executing the query is right ? because i found connections are existing on the datbase which i need to prepare the report .as per the query it is last accessed in a year ago .pls clarify
May 15, 2014 at 2:43 pm
ramyours2003 (5/15/2014)
is the information provided by executing the query is right ? because i found connections are existing on the datbase which i need to prepare the report .as per the query it is last accessed in a year ago .pls clarify
I would not count on the data from there being totally accurate. In fact if you actually look at the documentation it clearly states "Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.". This is pretty obvious the information is not totally reliable.
Did you read the link in my first post about login auditing?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply