Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Wednesday, March 21, 2012

Last Select Statement

Any ideas how I can find out when was the last update/select made in a database in SQL Server? Even if I can find any user login information, that would be useful too.

Regards,

Bala

With the SQL Server Profiler tool, you can monitor querying activity, including who's running the query. But you only get that information when it's running... I don't know of a general activity log SQL Server keeps that you could study.

-Ryan / Kardax

|||

You could try using Lumigent's Log Explorer or Red-Gate's Log Rescue, however these will not help with tracking SELECT statements but will help track modifications to the database's data or structure:

http://www.lumigent.com/products/le_sql.html

http://www.red-gate.com/products/SQL_Log_Rescue/index.htm

Note that the ability to obtain such information from a database's log file is dependent on both the database's recovery model and when the last log backup was taken (if appropriate).

Chris

Last repost: linked server local SQL login romote Windows login

If you mean local as in a non NT Authorisation then no.
If you mean local as in local NT User (non domain) then no.
If you mean a domain user id then yes, but you will need
to set up the remote computer.
J

>--Original Message--
>I have posted this twice, no response. Anyone from the
MS SQL Server team
>or anyone else could give me an answer? Thanks.
>Win2K, SQL Server2K.
>Hi group,
>can someone confirm me that this is not possible, or tell
me how to do it?
>For a local sql server login, the connectivity is to be
established with the
>remote login being a Windows login.
>Thanks.
>Quentin
>
>.
>Thanks.
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:2275701c45d2a$9c543370$a501280a@.phx
.gbl...[vbcol=seagreen]
> If you mean local as in a non NT Authorisation then no.
> If you mean local as in local NT User (non domain) then no.
> If you mean a domain user id then yes, but you will need
> to set up the remote computer.
> J
>
> MS SQL Server team
> me how to do it?
> established with thesql

Last repost: linked server local SQL login romote Windows login

I have posted this twice, no response. Anyone from the MS SQL Server team
or anyone else could give me an answer? Thanks.
Win2K, SQL Server2K.
Hi group,
can someone confirm me that this is not possible, or tell me how to do it?
For a local sql server login, the connectivity is to be established with the
remote login being a Windows login.
Thanks.
QuentinIf you mean local as in a non NT Authorisation then no.
If you mean local as in local NT User (non domain) then no.
If you mean a domain user id then yes, but you will need
to set up the remote computer.
J
>--Original Message--
>I have posted this twice, no response. Anyone from the
MS SQL Server team
>or anyone else could give me an answer? Thanks.
>Win2K, SQL Server2K.
>Hi group,
>can someone confirm me that this is not possible, or tell
me how to do it?
>For a local sql server login, the connectivity is to be
established with the
>remote login being a Windows login.
>Thanks.
>Quentin
>
>.
>|||Thanks.
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:2275701c45d2a$9c543370$a501280a@.phx.gbl...
> If you mean local as in a non NT Authorisation then no.
> If you mean local as in local NT User (non domain) then no.
> If you mean a domain user id then yes, but you will need
> to set up the remote computer.
> J
>
> >--Original Message--
> >I have posted this twice, no response. Anyone from the
> MS SQL Server team
> >or anyone else could give me an answer? Thanks.
> >
> >Win2K, SQL Server2K.
> >
> >Hi group,
> >
> >can someone confirm me that this is not possible, or tell
> me how to do it?
> >
> >For a local sql server login, the connectivity is to be
> established with the
> >remote login being a Windows login.
> >
> >Thanks.
> >
> >Quentin
> >
> >
> >
> >.
> >

Last repost: linked server local SQL login romote Windows login

If you mean local as in a non NT Authorisation then no.
If you mean local as in local NT User (non domain) then no.
If you mean a domain user id then yes, but you will need
to set up the remote computer.
J

>--Original Message--
>I have posted this twice, no response. Anyone from the
MS SQL Server team
>or anyone else could give me an answer? Thanks.
>Win2K, SQL Server2K.
>Hi group,
>can someone confirm me that this is not possible, or tell
me how to do it?
>For a local sql server login, the connectivity is to be
established with the
>remote login being a Windows login.
>Thanks.
>Quentin
>
>.
>
Thanks.
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:2275701c45d2a$9c543370$a501280a@.phx.gbl...[vbcol=seagreen]
> If you mean local as in a non NT Authorisation then no.
> If you mean local as in local NT User (non domain) then no.
> If you mean a domain user id then yes, but you will need
> to set up the remote computer.
> J
>
> MS SQL Server team
> me how to do it?
> established with the
|||Thanks.
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:2275701c45d2a$9c543370$a501280a@.phx.gbl...[vbcol=seagreen]
> If you mean local as in a non NT Authorisation then no.
> If you mean local as in local NT User (non domain) then no.
> If you mean a domain user id then yes, but you will need
> to set up the remote computer.
> J
>
> MS SQL Server team
> me how to do it?
> established with the

Monday, March 19, 2012

Last logon time

How do I find out the last time a SQL Server login id was
used? Is there a system table that will show last login
time? Thanks.The easiest way would be to enable auditing for successfull logins on SQL.
This will print the info you want in both the NT Application event log and
the SQL Errorlog. Otherwise, you could use Profiler to capture
login/logoff events and write them to your own table.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Check the actual SQL logs themselves. I believe by default SS retains 6
copies of the log since sp_cycle_errorlog was run or the instance was
restarted.
hth
Eric
"Jammin" <anonymous@.discussions.microsoft.com> wrote in message
news:079f01c3bf39$06e26fd0$a001280a@.phx.gbl...
quote:

> How do I find out the last time a SQL Server login id was
> used? Is there a system table that will show last login
> time? Thanks.

Last Logon Date

Is there a system table that shows the last logon date for a login?
Or is there a way to setup an alert or something to keep track of logon date
for a login?
Thanks,
KenKen,
You can trace this using Profiler or you can set up auditing for successful
and/or failed login attempts on the EM - Server Properties - Security tab -
Audit Level.
HTH
Jerry
"Ken" <Ken@.discussions.microsoft.com> wrote in message
news:806D9945-7352-49F3-B43C-97B3F838F9F2@.microsoft.com...
> Is there a system table that shows the last logon date for a login?
> Or is there a way to setup an alert or something to keep track of logon
> date
> for a login?
> Thanks,
> Ken|||I setup an alert for error 18453 Login succeeded trusted connection.
This works fine -- I get notified by an email. But I want to execute a job
from this alert to save the login information into a table so that I can
remove the login if it has not been used for a number of months. This is
part of our security audit.
My question is -- how can I pass the login info from an alert to a job?
Thanks,
Ken
"Jerry Spivey" wrote:
> Ken,
> You can trace this using Profiler or you can set up auditing for successful
> and/or failed login attempts on the EM - Server Properties - Security tab -
> Audit Level.
> HTH
> Jerry
> "Ken" <Ken@.discussions.microsoft.com> wrote in message
> news:806D9945-7352-49F3-B43C-97B3F838F9F2@.microsoft.com...
> > Is there a system table that shows the last logon date for a login?
> > Or is there a way to setup an alert or something to keep track of logon
> > date
> > for a login?
> >
> > Thanks,
> > Ken
>
>

Last login in sql server

Hello,
Is there any way to tell when a user last logged into sql server/system
without auditing set? Are there any system tables or sp that will give me
that information? Thanks.
--
New SQL Server DBANewbie,
For current processes:
SELECT LOGINAME,LOGIN_TIME FROM MASTER..SYSPROCESSES
For logins in the past...not that I'm aware of without using built-in
auditing, a custom auditing solution or third-party auditing software. A
shot in the dark, you might be able to determine this by evaulating the
t-log backups in the past with a third-party log viewer tool.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:7692EDE5-82DC-4538-91A0-0E380D41862F@.microsoft.com...
> Hello,
> Is there any way to tell when a user last logged into sql server/system
> without auditing set? Are there any system tables or sp that will give me
> that information? Thanks.
> --
> New SQL Server DBA

Last login in sql server

Hello,
Is there any way to tell when a user last logged into sql server/system
without auditing set? Are there any system tables or sp that will give me
that information? Thanks.
--
New SQL Server DBANewbie,
For current processes:
SELECT LOGINAME,LOGIN_TIME FROM MASTER..SYSPROCESSES
For logins in the past...not that I'm aware of without using built-in
auditing, a custom auditing solution or third-party auditing software. A
shot in the dark, you might be able to determine this by evaulating the
t-log backups in the past with a third-party log viewer tool.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:7692EDE5-82DC-4538-91A0-0E380D41862F@.microsoft.com...
> Hello,
> Is there any way to tell when a user last logged into sql server/system
> without auditing set? Are there any system tables or sp that will give me
> that information? Thanks.
> --
> New SQL Server DBA

Last login in sql server

Hello,
Is there any way to tell when a user last logged into sql server/system
without auditing set? Are there any system tables or sp that will give me
that information? Thanks.
New SQL Server DBA
Newbie,
For current processes:
SELECT LOGINAME,LOGIN_TIME FROM MASTER..SYSPROCESSES
For logins in the past...not that I'm aware of without using built-in
auditing, a custom auditing solution or third-party auditing software. A
shot in the dark, you might be able to determine this by evaulating the
t-log backups in the past with a third-party log viewer tool.
HTH
Jerry
"Newbie" <Newbie@.discussions.microsoft.com> wrote in message
news:7692EDE5-82DC-4538-91A0-0E380D41862F@.microsoft.com...
> Hello,
> Is there any way to tell when a user last logged into sql server/system
> without auditing set? Are there any system tables or sp that will give me
> that information? Thanks.
> --
> New SQL Server DBA

Last login for SA Account

How can I view when waa the last login for the SA account?The only way to track this is to either set Audit Level to All (not a great
idea as it tends to fill up the SQL errorlog and Application Event Log) or
have a permanent server side login trace.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Marcos Marrero" <mmarero@.netzero.net> wrote in message
news:59a96a25.0410130904.88a6485@.posting.google.com...
> How can I view when waa the last login for the SA account?

Last Login date

Hi,

How to find out the Last Login date of an SQL Login id in server.

Balavenkatesh

You can do something like this

select * from sysprocesses

Where loginame like ''

order by last_batch desc

|||

In order to view login statisctis you will need to enable the common criteria (CC) compliance option. For more information please refer to BOL (http://msdn2.microsoft.com/en-us/library/bb326650(SQL.90).aspx).

I hope this information helps, please let us know if you have further questions.

-Raul Garcia

SDE/T

SQL Server Engine

Last login

Hello everybody!!
Do you know how to find out the last login time for all acccounts ?
please, to instruct for me.
thank you very much. :lol:Hi,
SQL Server by default will not store the Last login time in any system
tables.
But you could go for any of the below 2 approaches to attain this:-
1. Enable the audit level for successful login and Faile Logins using
Enterprise manager ... SECURITY tab. This will put all the
successful and failed logins to sql server in sql server error log. You
could open the log and identify the last login time.
2. Write a stored procedure and read the Master..sysprocesses table every 1
minute (use SQL Agent jobs) and put it into a user defined table.
Later you could read this table to identify the last login time..
Thanks
HARI
SQL Server MVP
"william.huang" <william.huang@.saturn.yzu.edu.tw> wrote in message
news:OkGa0g6eFHA.3836@.tk2msftngp13.phx.gbl...
> Hello everybody!!
> Do you know how to find out the last login time for all acccounts ?
> please, to instruct for me.
> thank you very much. :lol:
>|||thanks
the second one did help
"Hari Prasad" <hari_prasad_k@.hotmail.com> glsD:OxxfTt7eFHA.3160@.TK2MSFTNGP09.phx.g
bl...
> Hi,
> SQL Server by default will not store the Last login time in any system
> tables.
> But you could go for any of the below 2 approaches to attain this:-
> 1. Enable the audit level for successful login and Faile Logins using
> Enterprise manager ... SECURITY tab. This will put all the
> successful and failed logins to sql server in sql server error log. You
> could open the log and identify the last login time.
> 2. Write a stored procedure and read the Master..sysprocesses table every
> 1 minute (use SQL Agent jobs) and put it into a user defined table.
> Later you could read this table to identify the last login time..
> Thanks
> HARI
> SQL Server MVP
>
>
> "william.huang" <william.huang@.saturn.yzu.edu.tw> wrote in message
> news:OkGa0g6eFHA.3836@.tk2msftngp13.phx.gbl...
>