Logging Sql Query Executions

Jan 30, 2008

Hi,
I'm looking for a way to log exactly which sql queries are executed on a specific asp.net page request. Actually I'm not looking for anything advanced here, just a log which writes all the queries to a text-file would be good enough for me.
 Does anyone know of a tool for visual studio that could help me with this or is there a way to build a logger like this by hooking into ADO.NET in some way?
 This would help me out a whole lot now as I with this log could see that my cache logic really is working as it should.
 
thanks!

 

View 4 Replies


ADVERTISEMENT

Logging Signons And Stored Procedure Executions

Oct 25, 1999

I'm looking for a facility similar to NT audit facility except for SQL Server 6.5.

Is there a tool or facility that will track when users log in (using SQL Server security), and either which stored procedures they execute or which tables they select?

View 1 Replies View Related

Logging Difference Between Designer And SQL Agent Package Executions

Dec 12, 2006

After fine-tuning my package logging, I built a query against SYSDTSLOG9 that uses the combination of the OnPreExecute events and any subsequent event for each task to build a nice view of a package in progress, including the duration of each event. (Running tasks would have a row with a NULL EndTime.)

When running the package within the Designer, everything works as expected. Events are logged at the task level and everything bubbles-up to the package level.

However, when I run the package from SQL Agent (using the SSIS job step), none of my OnPreExecute or sub-component events are written. That is, I only get package-level OnInformation, OnPostExecute and OnError events.

This means when the job/package is executing, I can't directly see which steps are currently in progress nor can I get a duration for each step once it's completed. This will be very disconcerting for my teammates who will have to help support this at some point.

Any idea how or why there would be a change in behavior between these two execution methods?

Thanks in advance for any help. Until then, banging my head against the wall...
Tim

View 8 Replies View Related

DTS Packages Executions

Jun 22, 2007

I have a weird situation. I have migrated some DTS packages from a sql 7.0 server to SQL2005. One of them works as a DTS package but fails under the job sections with an error saying could not connect to the database server. I have no option but to rewrite the whole package in SSIS(which I hate).

Any ideas.

Regards
Paresh Motiwala
Boston, USA

View 2 Replies View Related

Multiple Executions Of Same Package Using DTEXEC

Dec 17, 2006

Hi,

I have a file-deployed package which I need to call N times at once using DTEXEC.  When I attempt to execute N instances of the package, the second instance doesn't execute.  I can execute different packages at the same time, but never the same package more than once.  Does anyone know how to get this scenario working?  Just to clarify a bit more - I can call the package as many times as I like as long as I wait until the previous run of DTEXEC is finished.  Please help!

Thanks,

dcb99

View 2 Replies View Related

Prevent Simultaneous Package Executions

Oct 23, 2007

How can I prevent a package, or a section of a package, from being run more than once simultaneously? The package makes use of a staging database table, and if two copies of this package are run at the same time, there will be a race condition and possible corruption of the data in the database table. I have also noticed that the SSIS logging gets messed up and starts overwriting itself if I have more than one of these packages run at the same time.

What I am thinking of should work the same way as a serializable transaction lock on a normal query, where one query has to wait if another query has a lock on the table. I don't want the package to throw an error, I want it to wait until the other one is done.

I have been trying to use transactions in a test SSIS package, but they are not quite doing what I want them to do. I put various SSIS steps in a sequence container and require a serializable transaction. I have also tried putting the transaction at the package level, but that is not preventing simultaneous package runs.

Is there a built-in way to do this that is easy to implement? Otherwise, what I could do is insert a flag into the database indicating that a package is running, then make sure to reset the flag on any error or on completion. It seems like this alternate method could be error-prone though.

I am using SP2.

View 8 Replies View Related

T-SQL (SS2K8) :: Determine If 3 Most Recent Job Executions Have Failed

Dec 29, 2014

I'm looking for feedback on a query I've devised to return a numeric value if the 3 most recent executions of a job have failed. The purpose of the query is to server as a custom counter alert for Idera SQL DM, and by definition an SQL Script alert must return a numeric value.

My environment is SQL Server 2008. Note that the job name is hard coded.

;WITH CTE_Restore_JobHistory AS
(SELECT h.[job_id]
,j.[name] as JobName
,h.[message]
,h.[run_status]

[Code] .....

View 2 Replies View Related

Best Way To Handle Data Connections For Multiple Users And Executions.

May 3, 2008

 basically, is it inefficient to open and close a data connection everytime data needs to be retrieved or is there a way for a user to use the same conenction over multiple pages orfor multiple users to share one global data connection I just wanted to know this before I built a site where data could be constantly being pulled or put into the database.It would be easier to just keep opening and closing the connection since it just means pasting in the small chunk of code I use to do that where I need it. I hear speak of connections sometimes not closing etc and wonder if that is an issue then if you are opening and closing too many of them. I am using SqlConnection SqlCommand and SqlDatareader , my code works, just wondering if my approach lacked scalability before I find out too late and have to rewrite everything . Jim 

View 11 Replies View Related

Logging To Event Viewer Fails But SQL Server Logging Works OK - Why?

Jun 18, 2007

Greetings,



I am developing a package on my local workstation. I have defined two logging service providers. One is for SQL Server and the other is for the Windows Event Log. I am using the Dts.Log method in a script task to write log entries.



Logging is working properly with the SQL Server provider and rows are being inserted into the sysdtslog90 table. However, the only events that are being logged in the Windows Event Log are the package start and end events which I believe SSIS is doing automatically anyway.



Is there something I need to do to enable WIndows Event Log logging other than defining a log provider and making sure it is checked active? Won't SSIS write to two different logs with one Dts.Log call? Any ideas on what might be going wrong with my approach?



Thanks,

BCB

View 3 Replies View Related

Logging Messages In Query

Feb 25, 2008

Hi,
How to log queryresult messages (not result) into file using sql query?

I am looking for storing results into file like (2 Rows affected) and also error messages thrown by system.Any idea?



Regards
Arun.M


View 10 Replies View Related

Logging Package Name For Any Event In Sysdtslog90 Logging Table

Oct 17, 2007



Hi,
I decided to use the SQL Server log provider to store logging data of all my Integration Services packages. I also created some reports about this data for operating purposes.
I have a problem occurs the name of the executing package is not always written to the log,but the name of the single task which failed. But that is not very useful information for operating, because I do not see any chance to get the name of the package by the information which is logged in the sysdtslog90 table in the database which I defined for SSIS Logging.

How do I configure the package to always log the package information into the table, too?


Best regards,
Stefoon

View 5 Replies View Related

Analysis Server Needed For Query Logging?

Jan 8, 2008

Hi,

Is it true that I need Analysis Server to simply log the queries being sent to my databases?

I am not familiar with SQL server. In MySQL it is a simple checkbox setting; when I check it, all queries reaching the database(s) are written to a file. But accomplishing this in SQL Server is not so easy, so it seems. I read that I need Analysis Server to do this. I only bought the database, so I will have to purchase it. But I am not sure that this is, in fact, what I am looking for. I need a file that contains something like this:

01/08/2008 14:19:21 UserNameDbName: SELECT name, telno FROM Customer WHERE country = 'Netherlands' AND name LIKE '%bicycle%'

I need the queries exactly as they are sent to the database, from any (type of) client. Can Analysis Server provide this?

Thx,
/sohan

View 6 Replies View Related

Logging Query Messages From ExecuteSQL Task

Dec 15, 2006

The ExecuteSQL task makes it easy to capture the resultset of a query or stored proc in a variable. But what about the messages that would normally appear in the Messages tab when running queries in Management Studio or Query Analyzer? There must be a way to display and log rowcounts and other messages that a query normally produces.
 
Various package/task logging configrations haven't helped. I've read discussions about logging rowcounts in data flow tasks, but what about capturing messages in ExecuteSQL and other control flow tasks that run T-SQL?
 
I only have enough time to dabble in this technology so I may be missing something obvious or approaching this incorrectly. Any suggestion, reference, constructive criticism or reponse would be appreciated.
 

View 15 Replies View Related

Tie Together Custom Logging And SSIS Logging?

Sep 12, 2005

I recently read the project real ETL design best practices whitepaper. I too, want to do custom logging as I do today, and also use SSIS logging. The paper recommended using the variable system::PackageExecutionId to tie the 2 logging methods together.

View 4 Replies View Related

Logging In

Dec 6, 2006

How can I check from database username and password? It doesent need any special authentication, just a lookup through the database and if the user exist than continue with the next page.Thanks 

View 2 Replies View Related

Logging Who Did What

Oct 1, 2004

I have a web application accessing a SQL Server database (the ususal stuff).

I want to be able to log who did what on which table. I need to display this information on the web application. Is there an easy way of doing this, rather that making duplicates of a lot of data?

The best way I have thought of so far is making a new table with the following fields:
Table_Changed
Table_Primary_Key
Old_Field_Value
New_Field_Value
User
Date_Changed

Every time someone changes something, it is logged in this table, so that, at any time, I can display who changed what.
I have one more question. If I do do it this way, is there a way of getting the primary key value of any table? E.G. could I do something like this_table.primary_key.value ?

Jags

View 3 Replies View Related

Logging

May 30, 2001

Is there a way to produce a log of all SQL statements hitting a database in a given range of time by a specific SPID? Obviously the SQL Server activity logs do not go into that much detail, except when errors are produced or a change is made to a system table. Is there a setting to add more detail, or to log a specific SPID's actions, or maybe a third party software that will give me what I am looking for?

Thanks. JT

View 1 Replies View Related

Logging ?

Aug 22, 2000

does SQL 7.0 have any built in logging capabilities to identify row level actions by operator. For instance, can it tell me that a particular user deleted or inserted a row? How would I tell it who the operator is?

View 2 Replies View Related

DML Without Logging

Jun 11, 2004

Is there a way to stop logging DML? I have a large delete and I dont want to log the operation, is it possible?

View 2 Replies View Related

SQL Logging

Dec 9, 2004

Hi,

is there any chance to log all incoming SQL-statements with date/time and duration ?

Thx for help.

dajm

View 2 Replies View Related

Logging

Aug 20, 2007

Is there anyway to log every incoming command, INSERT/UPDATE/SELECT/DELETE to a seperate database table?

Thanks

View 4 Replies View Related

Logging Changes

Mar 27, 2008

I've been asked to write a trigger that will basically log changes to certain fields in certain tables, then create a front-end application where the user will be able to review the info. The front-end app. is not a problem for me - the trigger is. I have found example of how to do this on Update when it's a complete row you want to log, but not a specific field. In addition, I also need to know if someone is attempting to read certain data and who that user is. If the user is not someone that is allowed to read the data, then I need to send an email alert.
I believe it's possible to do the above (despite my lack of knowledge :) -
Does anyone know where I can get more information on how to accomplish the above - or where to start looking?
Thanks to any who can guide me in the right direction.

View 1 Replies View Related

Logging SQL Queries

Dec 16, 2007

Hi,I´m currently playing around with ASP.NET.Is there a way to log all Queries that are send to the SQL-Server? Something like the query.log of a Mysql.

View 3 Replies View Related

Logging In To MSDE

Dec 16, 2003

I have a problem acessing MSDE. My server runs at "NT AUTHORITY/NETWORK SERVICE" so it is not allowed to connect through the windows authentication feature. It seems that the password for the "sa" user account was changed during setup, after reading the logs from the setup I can see that it was changed but I cannot see what it was changed to. How would I set up a new account that I could use to access the server though SQL Authentication???

David Legg

View 1 Replies View Related

Transaction Logging

Oct 20, 2005

Lets say I have version 1 of a database - DB1. I  am creating the second database, DB2.

What I need is a log of all the SQL statements that where used to
change DB1 into DB2. This means recording both what happened in the GUI
and in the SQL Query Analyser.

Is there a way I can do this? I know SQL Server has a transaction log
somewhere. Is there a way to set this to output all the changes made
from a set date on a database into a SQL log file?

Thanks in advance for any help.

Jagdip

View 3 Replies View Related

Inserting Without Logging

Jan 31, 2002

Other than doing bulk insert is there a way to insert in SQL 7 without logging the transaction in order to speed up the process?
If so what command(s) allow this?

View 1 Replies View Related

DTS And Transaction Logging

Jan 29, 2001

If you use the import feature of DTS to import data into various tables and your database is setup with truncate log on checkpoint set to false, will SQL Server log those transactions?

Thanks,

Veronica

View 1 Replies View Related

Deadlock Logging

Nov 8, 2001

I have (amongst many) an overnight SQL stored procedure that occasionally takes over an hour to run compared to its usual 2 minutes. It does the same each night, as does everything around it. (N.B. The job truncates and reinserts data into a table.)

I'm just wondering if a user request during the day that reads the table perhaps leave the PID open and thus a lock open with it. Then, perhaps my SQL job comes along and waits for the lock to release before it performs the truncate.

Couple of questions:
1. Could this happen?
2. If so, is there a log anywhere to suggest that a deadlock situation arose and PID x was the loser?

Thx in advance.

Andy Richardson

View 2 Replies View Related

Is Any Way To Reindex 27 Gig Db Without Logging

Sep 25, 2002

Hello everybody.
1. I have 28 Gig database with 4 tables above 4 Gig each with very bad
fragmenataion, each table has between 3 and 5 indexes
2. Database set for full recovery and I use custom log Shipping to restore
db on stand by server every 15 min.

I tried to run DBCC INDEXDEFRAG on one index on 4Gig table .
following took place
1. It took 4 hrs to complite DBCC INDEXDEFRAG
2. log shipping fail.
3. log file size of 2 Gig generated after DBCC INDEXDEFRAG complited

I tried to run drop and create clustered index on table it create same
problem - log growing, log shipping fails

(if log shipping fails and stand by database get suspended it will take 6- 8
hrs to restore it from backup and apply all logs)

So my question is

What would be best way to rebuild- reindex - defragment 28 Gig database
when it set to fully recovery and log shipping


Thank you
Alex

View 1 Replies View Related

DTS Progress Logging

Nov 22, 2002

I need to logg progress of a DTS job. How do I do that? I'd like the progress to be stored in a file and emailed to me.

I need to track progress of the transfer of each table in two databases.

View 2 Replies View Related

Update With No Logging

Jul 6, 1999

I would like to update a SQL 6.5 table with modifications to certain columns, but I don't want any of it logged. Is there a way to do this? Any help is appreciated.

View 1 Replies View Related

Error While Logging

Apr 15, 2008

Hi all,

I am getting the following error when I log into SQL server using MS SQL Server Management Studio.

"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: TCP Provider, error: 0 - No such host is known.) (.Net SqlClient Data Provider)".

I tried to allow remote connections using Surface Area Configuration, but it is not allowing me to do so.

I am not sure what I need to do. Anybody, please advice.

Thanks & Regards

View 20 Replies View Related

Logging Blocks

Apr 23, 2008

I would like to log blocks to see what causes it.

One hack of a way to do it is to run code similar to that which populates the blk column in sp_who; on a job every 5 seconds. It would store the results of code similar to the sp_who output whenever any of the rows has a value greater than zero in the blk column.

This way, I can see what was going on at the time there was a problem.
Does anyone have a better strategy for this?

View 17 Replies View Related







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