Script To Check The History Of User Logs

Jun 13, 2008

Hi there,

I was wondering if anyone knows how to do it.
We have a couple of servers, each of which hosts tons of databases.
I am trying to write a script to check whoever has logged into any database within the past week, for example (not just the current users). I have tried 'sp_who' and 'sp_who2' but they are not meeting my needs.

Appreciated!!

View 2 Replies


ADVERTISEMENT

Transaction Logs And Check Points

Aug 14, 2001

Previously I have posted about my problem with transaction logs. Threw my research I have found the truncate log at check point. I have also been lead to think that a check point could be a full back up. I have set this option to true and then performed a full back up. Afterward I have shrank the database to find the transaction log to still be over 43 gigs. Where have I gone astray?

Regards

SeTi_Ni

View 1 Replies View Related

How To Store User Logs..

May 7, 2008

Hello all,
In my co-operation we have a database which users are making changes on it. What I am trying to do is;
I want to store all changes on the database, the user€™s information logs and I want to store it on a specific table. But I am facing a difficulty to make this.
For example,
if a user makes a change on the database, I want to store what kind of change does he/she makes, the time of the process and users information (IP address, login id) on another specific table thus I can store the process logs of my users.
In my testing I can store the user€™s login_id, user€™s ip addresses and the login info with using

sys.syslogins
sys.dm_exec_connections
sys.dm_exec_sessions

except storing the requested queries and the changes of the processes. Is it possible to store logs of the users? How can I do that?

I will be appreciated of your help.
Regards,

View 3 Replies View Related

Is There A Way To Fire A Trigger When A Particular User Logs Into Sql Server?

Nov 15, 2005

Is there a way to fire a trigger when a particular user
(with sql login) logs into sql server?
We are planning to use the above trigger to start a job which inturn records some inf.

Thanks.

View 1 Replies View Related

Securing A Database When The User Logs Onto The SQL Server.

Oct 4, 2007

Hello.

Not an SQL admin. We have an SQL 2005 server that has about 5 DB's on it. One database is maintained primarily by a third party. Often when they need to do upgrades they login remotely to the desktop of our SQL server. Is there a way to apply permissions to specific databases like you would for NTFS? That way they can only backup their database and not do anything to any other databases? Thanks.

View 3 Replies View Related

Error While Check For User

Jun 5, 2008

my aspnetdb.mdf can,t created  my remote connection settings in sql server is ok
and i get this folwing error :
 
 
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Source Error:



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:



[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +1093
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1083
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +351
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +90
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +115
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122
System.Data.SqlClient.SqlConnection.Open() +227
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +110

[HttpException (0x80004005): Unable to connect to SQL Server database.]
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +181
System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +167
System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +46
System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +681

View 1 Replies View Related

Where Can I Check The User License In MS SQL 7?

Aug 1, 2001

dear all,
i need yours expertise to help me find out the number of user license in the Ms SQL 7. beside that, can i increase the number of user license manually.
Thank.

regards dennis

View 1 Replies View Related

User/Role Check

Jun 5, 2000

Can anyone out there help me write a sp to determine if a user has a certain role?

I'm trying to use "sp_helpuser @UserName".

Can I declare a cursor with "EXEC sp_helpuser @UserName"? I'm not having success with this.

What about SELECT [GroupName] FROM EXEC sp_helpuser @UserName WHERE [GroupName] = @GroupName? Again, syntax error.

Is there already a better way that someone knows of?

View 1 Replies View Related

How To Check User Accessibility.

May 21, 2008

hi
i want when user connect to sql server and wants to do some works via my app, before doing nothing, check accessibility of user whether he/she can access that object or not, but i don't know which sp or function or view is useful for this work,can anyBody help me ?
thanks

View 6 Replies View Related

Check User Authorization

Jun 16, 2008

I need to write a sp (for my web app) that checks user authorization. Here is the scenario:

User Authorization Table (AuthTable)

UserIDFrom Cost CenterTo Cost Center
(UserId)(FromCC)(ToCC)

User130003600
User148005120
User152005250
User230003400
User237603840


Production Table (ProdTable) data:

Job NumberCost CenterQuantity
(JobId)(JobCC)JobQty

51002860250
51003120525
51004801262
52003001155
52005251276

I need to check the user security for each record that I read from the ProdTable against all entries in the AuthTable for the current user.

When I read the ProdTable and User ID = User1 then selected records should be:

5100/3120, 5100/4801, 5200/3001,

When I read the ProdTable and UserID = User2, then the selected records should be:

5200/3120

I’m not sure how to construct my sql statement. Can somebody give me a hand? Thank you.

View 1 Replies View Related

Check User When Using Enterprise Manager

Aug 5, 1999

Hi all,

When I use Administrator to login the NT, I can use the Enterprise Manager.
If I don't logout the NT, any users can easy to use the Enterprise Manager too.
I would like to know is there any way to add a security checking to avoid user without
privilege to use the Enterprise Manager?

Thanks

View 1 Replies View Related

Check Constraint User Notification

May 21, 2008

Hi

I've created a check constraint using the dialogue box in SQL Server , which blocks out the insertion of records which do not meet the required the requirements.

Is there a way to be notified when the record has not been inserted?

Thanks

View 1 Replies View Related

Domain User Access Check

Jun 20, 2008

How to find out whether a domain user has access to sql server or not?

Many domain groups have access to my sql server. I need to check whether a user has access to server or not.

Probably I need to check which windows group the user belongs. This looks more like an o/s question than DB. How do you guys manage this scenario?


------------------------
I think, therefore I am - Rene Descartes

View 4 Replies View Related

Check Which Group User Belongs To

Jul 15, 2015

we  do get incidents saying user can't login even adding to the group.So is there any script to check which group the user xxxxx belongs to from SSMS?

View 2 Replies View Related

Check Binding Of A User With A Login

May 21, 2008



Hi,
When i restore a database from a different SQl 2005 instance to another,
i want to check if the logins are same and if the users in the destination db are all binded to the logins.
How can i do that?

Any help?

View 4 Replies View Related

DB Engine :: Write Logs To Windows Event Logs?

Aug 6, 2015

OS: Windows 2012 Enterprise

SQL Server: 2012 Enterprise

I was wondering if there is any way all SQL Server error log entries could be automatically written to Windows Event Log. 

View 3 Replies View Related

How Check Either One Name Of The User Is Present Or Not In Data Table From C#.net

Jan 31, 2008

hi
 can anyone help me out, i have one issue that is how i have to check while adding new user details to database table weather that user name is exist in that table or not.
for my application i'm using oracle database and C#.Net.
table is g_users and columns are:
 Name                                      Null?    Type ----------------------------------------- -------- ---------------------------- USERID                                    NOT NULL VARCHAR2(5) NAME                                               VARCHAR2(20) EMPID                                              VARCHAR2(5) USERNAME                                  NOT NULL VARCHAR2(30) MOBILE                                             NUMBER(12) EMAILID                                            VARCHAR2(20) DOMAIN                                    NOT NULL VARCHAR2(30)
i need to check from c# programming before inserting a new row into table weather username is already exists are not. how to check this one?

View 5 Replies View Related

Please Help! How Can I Check The Current User Against A Specific Database?

Apr 29, 2008

In my application (infopath browser forms), First I get current user name thru System.Environment.UserName, after that, i want to check whether this user has access (read & write) permission to certain database, How do I do that?
One way I tried before is to get all the users and stored the names in an array for comparing in my program, but can not figure out the SQL command (to get the database users), if there it is, please kindly tell me.
Or if I can just pass the current user to check?
Thanks in advance.

View 5 Replies View Related

Check If A Windows/nt User Account Exists

Oct 26, 2006

I have some script which creates/grant priveleges to windows/nt users to DB but i frequently get the message below:

Windows NT user or group '<user or group>' not found. Check the name again.

I understand that this is because the said user/group is indeed not present in the environment I'm running the script (ie. testing and production environment).

But is it possible to have some sort of checking whether the user/group exists in the environment so that I could determine whether or not to call some lines of code?

Not sure if this is possible so i had to ask. c",)

View 7 Replies View Related

Transact SQL :: How To Check If Current User Has Sysadmin Privs

May 27, 2015

Is there a simple command that can be executed to check if the current user has sysadmin privs?  I just want to check to see if I have sysadmin privs and if so then execute a command, if not do nothing in .Net code.  I just want to do this check once and set a variable in the .net code.

View 4 Replies View Related

SSIS Logs Vs Custom Logs Components

Feb 12, 2007

Hi,

In my case I have to log the errors raised by any task in a package to either windows event log, text file or SQL server. Also I need to send an email notifications to a group of people telling them about the error.

Now can I use SSIS package logging for logging the errors into the required destinations. I mean right clicking on the package and selecting Logging, then adding the required log providers and enabling the events for logging into those. I think I have to upfront select the log providers to log the error, I will not have the liberty to log the error to the destination, the name of which is passed as a variable to the package. This is okay with me though.

Now what will a custom log provider help me to do in this case. Also can I somehow configure my package to call the send mail task everytime an error is raised.

Also, one more option can be developing a package that only does the error handling. It will take in the paramters or the error codes and descriptions, the destination to write to and a flag to send mail or not for that particular type of error.

What do you think? Kindly advise.

Thanks in advance for your help and time.

Regards,

$wapnil

View 3 Replies View Related

Check User Supplied Date Range Is In Between Startdate And Enddate?

May 3, 2012

I need query which will check user supplied date range is in between the existing table startdate and enddate.

if any of the date of user supplied date range is in between the tables start date and end date,it should retrun that record from table.

for example user supply date range is from 1 may 2012 to 5 may 2012.

then query must check that

1 may 2005
2 may 2005
3 may 2005
4 may 2005
5 may 2005

(all dates) is in between startdate and enddate of existing table.

View 2 Replies View Related

Sql2005 Express 'windows NT User Or Group Not Found. Check The Name Again.

Feb 26, 2006

I have installed visual studio 2005 with sql express. My tutorial book asked me to do the following to be able to use sql.

sqlcmd -S mycomputernameSQLExpress -E

which worked and then I get

1>

where I am to put in

1> sp_grantlogin [mycomputernamemyusername]

2> go

after this i get the error.

Msg 15401, Level 11, State 1, Server mycomputernameSQLEXPRESS, Procedure sp_grantlogin, Line 49

Windows NT user or group 'mycomputernamemyusername' not found. Check the name again.

I used Local System for the user name as that is what I think I am seeing as the right user account.

Help?

View 4 Replies View Related

SQL Server Admin 2014 :: User Database Integrity Check Fail

Mar 8, 2015

I've been running the Ola Hallengren maintenance script for the last five months without missing a beat. Today I find an error stating the UserDatabase Integrity check job failed last night. This is running on SQL Server 2014 BI edition w/64 Gigs.

I ran a DBCC CHECKDB on each database manually and all worked until I tried it on the biggest one that is about 18 gbs. It just keeps running and I eventually stopped it so I'm guessing it is memory, but doesn't make sense considering it has 64 gbs. I have it set to 64/4 max / min. Again, this was never an issue until last night.I've been looking up all morning, but not seeing much on this error "The operating system returned error 1453"?

View 5 Replies View Related

SQL Server Logs (error Logs)

Aug 28, 2001

When looking at SQL Server error logs, I noticed that the current error
log had grown to 1MB whereas most of the files are only a few KB.

QUESTION 1: Can I set the max size for an error log file? If so, how?

QUESTION 2: If not, is there a workaround?

Thanks

View 1 Replies View Related

Reporting Services :: Check Access Fails To Grant Access To Report Item For Current User

Sep 10, 2015

Is there any way to get more information for when IAuthorizationExtension::CheckAccess fails to grant access to a report item for the current user? Specifically, it would be useful to know:

1. URL of attempted report
2. IP address of user agent
3. Identity of current user
4. Date/Time of the failed attempt

ssrs2014

View 7 Replies View Related

Data Access :: How To Check All Connection Automatically During Routine Check By Using Batch File

May 20, 2015

I have multiple ODBC connection and how to check all connection automatically during routine check by using batch file.

View 5 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related

How Do We Determine Which User Database Tables Are Mostly Retrieved By User Or Modified By User?

May 22, 2008



Hi,
Please give the T-SQL script for this ? Thanks

Shanth


View 4 Replies View Related

Job History

Jul 24, 2001

The 'view job history' on Enterprise Manager is showing me only 4 or 5 run histories. I want to see more history on each of the jobs.Even I changed the limit to 10000 lones from 1000 lines on the server properties in the job system option, I am still seeing only the last 4 or 5 histories for each job(there are a total of 70 jobs on the server).Any ideas??Thanks.
Reddy.

View 1 Replies View Related

Job History Not There

May 15, 2000

Anyone tell me why some of my SQL-agent jobs have no history?
Some jobs are reporting history fine, others say "No history"

View 4 Replies View Related

Job History

Jul 6, 2000

I have set up a job as sa.After that I changed the sa password.Now I am not able to view the job history since then.Do i need to delete the job and reschedule it?

View 1 Replies View Related

SQL Job History ???

Aug 18, 2004

I have a question about the sql job history. I have a sql 2000 server that was recording all the job history on my sql jobs just fine until the other day. Today I checked the history and the jobs didnt show the past history anymore. Just today's history. So if the job didnt run today there is no history for that particular job. This isn't true, the job was run a few days ago. I know that no one went in and cleard the history on the jobs. What causes this issue, is there a way to not make this happen in the future? Is there a way I can recover the past history for my jobs.

Thanks for your time!! TIA

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved