How Can We Capture Dataflow Events In IDtsEvents Implementations?
May 25, 2008
Hi,
I'm playing around with IDtsEvents.
I've noticed that the /rep option of dtexec allows me to specify that dataflow events are outputted to the console during execution. Here's an example of a dataflow event:
Code SnippetDataFlow: 2008-05-25 22:27:52.08
Source: DFT My dataflow
Component "Union All" (18) will receive 1807 rows on input "Union All Input 1
" (19)
End DataFlow
However, I can't find a method on IDtsEvents that enables me to capture dataflow events such as the one above and that seems a bit strange to me.
So, question is... Is there a way of capturing dataflow events in an IDtsEvents implementation and if not, why not?
Thanks
Jamie
[Microsoft follow-up]
View 21 Replies
ADVERTISEMENT
Nov 21, 2006
Does anyone know how to create an eventhandler for a dataflow task specific events (OnPipelinePostEndOfRowset, OnPipelineRowsSent, etc.)? These events are available for logging via the standard logging infrastructure, but there seems to no eventhandler for them.
The reason I'm interested is that parsing information logged by these events using builtin log providers is not easy (eg., the number of rows sent gets burried somewhere in the message column (i'm using sql provider). I'd like to capture this information and record it cleanly in a custom ssis metadata database i'm building. Any ideas are welcome. Thanks.
-alex
View 8 Replies
View Related
Feb 19, 2015
I know very little about Extended Events, but I know it is supposed to be more powerful than Profiler. The SQL Instance involved is 2008R2. I was asked whether we could capture when a stored proc was called with a certain parameter. So for example, if dbo.usp_mystoredproc is called and is passed a value of '12345a' for @customer, can that be captured? I would want to know the time it was called, the parameter and parameter value. Probably would be interested in the SPID or LoginName as well.
View 4 Replies
View Related
Jun 20, 2007
Hello experts. I have been searching for anything about this but found very little. What are the events logged in SQL Server Error Logs aside from Successful/Failed Login, Backup/Restore/Recover database and, start/init sql server? Can we configure this to log other events, like CREATE or DBCC events for example? If so, how? Thanks a lot.
View 1 Replies
View Related
Jun 7, 2001
Hi,
Does anybody know any web based application or site which has been implemented on SQl Server 2000. I need some examples of up and running applications so that i recommend this product to my client.
Thanx,
Vinod Kumar
DBA (Prodapt Solutions)
View 2 Replies
View Related
Jan 28, 2006
I have a start date, end date for each event.
I want to list all events between the start and end date comes in Saturday or Sunday.
in SQL server 2005 TSQL statement.
any insights ?
View 1 Replies
View Related
Feb 3, 2014
I am using this code for LongRunning Queries.
CREATE EVENT SESSION LongRunningQuery
ON SERVER
ADD EVENT sqlserver.sql_statement_completed
(
ACTION (sqlserver.sql_text, sqlserver.tsql_stack)
WHERE sqlserver.sql_statement_completed.duration > 60000
[Code] ...
Here Instead of writing to XML file how can send an EMAIL if a query runs more than 1 minute in my server ?
View 2 Replies
View Related
May 25, 2008
Hi,
The IDtsEvents.OnError method has a boolean return type whereas most of the other methods on that class are voids.
Why does OnError return a boolean?
What is the effect of returning true?
What is the effect of returning false?
Thanks in advance
-Jamie
[Microsoft follow-up]
View 4 Replies
View Related
Sep 27, 2006
I am executing a package via vb.net with package.execute using the IDTSEvents interface inheriting DefaultEvents. I am trying to emulate DTExec functionality. The package runs fine and I am catching events, but I don't get nearly as many info and progress events as are put out by DTExec. From my understanding DTExec also used the managedDTS application object, is that not the case? If it uses this does anyone have an ideas on how it is grabbing more events? For example I don't get these events that DTExec shows ..
Info: 2006-09-26 14:22:27.97
Code: 0x40016041
Source: DWB02130
Description: The package is attempting to configure from the XML file "D:SSISConfigurationsDatabase.dtsConfig".
End Info
Info: 2006-09-26 14:22:28.05
Code: 0x40016040
Source: DWB02130
Description: The package is attempting to configure from SQL Server using the configuration string ""Configurations Database";"[dbo].[SSISConfigurations]";"DWB02130";".
End Info
I also don't get as many progress updates during validation, I basically get 0 and 100% while DTExec shows several 1%, 3%, 10%, etc.
Any help is greatly appriciated.
Thanks!
Harry
View 1 Replies
View Related
Jan 26, 2006
I am running a package from a C# application. I would like to use the IDTSEvents interface to capture events from the package such as OnPreExecute, OnWarning, OnError, etc. I created a class (PackageEvents) that implements the IDTSEvents interface. I pass a PackageEvents object into the Application.LoadPackage call that creates the package. The package runs successfully as usual, but nothing happens in my PackageEvents class. None of the breakpoints hit (I put one in every function).
What do I need to do to get the class that implements IDTSEvents to be called? All the properties of the package object seem reasonable at runtime.
Here is a code snippet that shows what I am trying to do:
// Class that implements the IDTSEvents interface:
public sealed class PackageEvents : IDTSEvents
{
void IDTSEvents.OnPreExecute(Executable exec, ref bool fireAgain)
{
Console.WriteLine("OnPreExecute");
}
....
// Code to run the package
Application app = new Application();
// PackageEvents implements IDTSEvent (see above)
PackageEvents packageEvents = new PackageEvents();
Package package = app.LoadPackage("C:\temp\Package.dtsx", packageEvents);
DTSExecResult result = package.Execute();
View 8 Replies
View Related
Apr 17, 2007
Dear Friends,
I need to execute a SQL query, inside a dataflow (not in controlFlow) and need the records returned to continue the dataflow... In my case I cant use lookup and OLE DB COmmand and nothing else...
I need to execute a query and need the records for dataflow... with OLE DB command I cant see the fields returned... :-(
How can I do it? Using a script? Can I use a Script Component? That receive 2 parameters for input and give me the fields returned from query as output?
Thanks!!
View 38 Replies
View Related
Jan 10, 2008
Hello All,
I recently learned of the DiskPart.exe tool that is used to improved the performance of Exchange 2003 cluster implementations. The articles I read alluded to the fact that improperly align disks could ruin the phisical devices themselves due to stress.
So my question is:
How come the MS documentation does not suggest using "Disk Partitions Track-Aligned" methods to improve SQL?
Is there some big difference in the way these two server suites managed I/O reads/writes?
- Rashad Rivera
www.omegusprime.com
View 1 Replies
View Related
Mar 20, 2004
I would like to AUTOMATICALLY count the event for the month BEFORE today
and
count the events remaining in the month (including those for today).
I can count the events remaining in the month manually with this query (today being March 20):
SELECT Count(EventID) AS [Left for Month],
FROM RECalendar
WHERE
(EventTimeBegin >= DATEADD(DAY, 1, (CONVERT(char(10), GETDATE(), 101)))
AND EventTimeBegin < DATEADD(DAY, 12, (CONVERT(char(10), GETDATE(), 101))))
Could anyone provide me with the correct syntax to count the events for the current month before today
and
to count the events remaining in the month, including today.
Thank you for your assistance in advance.
Joel
View 1 Replies
View Related
May 29, 1999
What we are trying to do is watch a table in one database for an insert. If something is inserted into a unique ID column, we want to go to another database, on the same server, and look for that same number and place a value in another column for that record. Any ideas?
View 1 Replies
View Related
May 16, 2008
as asap pl give the detailed and clear description reg differences between delegates and events
vedavathi zend
View 3 Replies
View Related
Dec 16, 2005
I'd like to build an application that will react to specific changes todata in a set of tables in a database. The application would replicatethese data changes to another database. The target database won't beSQLServer. Neither is this simple replication, at times the applicationwill need to get extra data from the source database before the targetis updated.In other DBMS systems I am involved with the DBMS has the facilty towrite to an application message queue so that the monitoring applicationonly has to monitor the queue rather than a database. What I'd like todo is something like this:1. Some application changes data in a table.2. A trigger reacts to the change and writes a message to an applicationqueue.3. A windows service/process monitors the queue and picks up themessage. It then carries out whatever replication/DB actions are necessary.This would mean defining a number of new triggers on existing tables anddeveloping the windows service/process. Existing applications and theexisting tables in the database would remain unchanged. I'm not awindows programmer but I have someone in my team who is and who willbuild the windows service/process.The bit I'm unsure about is how a trigger can write to an applicationqueue or communicate with the windows service/process. I may be usingthe wrong terminology as I have more knowledge of Unix than Windows.Could anyone help with how I can do this or suggest any alternativestrategies.Thanks In Advance.Laurence
View 3 Replies
View Related
Aug 30, 2006
Just finishing of a large ETL system and have aquestion about the following:-
We have 164 child packages being called from a single parent package which is setup to perform logging to a SQL Server table. Anything that Errors or has Warnings is logged accordingly, however, how do you trap the PackageStart and PackageEnd events? when the child package knows nothing about logging?
My first thought was to have the Parent call the AddEvent SP with the appropriate values, but thought I may check here in case I missed something
View 5 Replies
View Related
Aug 30, 2007
Hi,
I'm trying to catch an error and trigger a control flow to handle it. I introduce a control flow to catch "OnError" event, but , despite muy package has some errors it doesnt work...
Another issue, if i omit an error on a transformation object ( in order let the flow continue executing), can this error be managed by an event or record it in a log?
Thanks
View 6 Replies
View Related
Oct 25, 2007
Hi
I would like to know how I can get hold the text for a service and event notifications.
What I need is the ability to get hold of a list of the events I'm currently monitoring.
i.e.
Server or database level
I though I would be able to get hold of this in sys.server_event_notifications but it doesn't seem to have any data although my server level event notifcation service is running.
Any help?
TIA
View 1 Replies
View Related
Nov 17, 2006
I have the following code and I'm trying to set an event dynamicly in the foreach statement...
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["BvtQueueConnectString2"]);
SqlCommand select = new SqlCommand("select top 100 b.jobid as [Job ID], bq.timesubmitted as [Time Submitted], b.timereceived as [Time Received], bq.requestid as [Request ID], bq.timecompleted as [Time Completed], bq.buginfoid as [Bug Info ID], e.eventid as [Event ID], bq.closingeventid as [Closing Event ID], et.eventtype as [Event Type], e.eventtime as [State Start Time], l.twolettercode as [Language], p.projectname as [Project Name], p.packagedesignation as [Package Designation] from bvtjobs b inner join bvtrequestsnew bq on b.jobid = bq.jobid inner join eventlog e on bq.requestid = e.bvtrequestid inner join eventtypes et on e.eventtype = et.eventtypeid inner join languages l on bq.targetlanguage = l.langid inner join projects p on bq.targetplatform = p.projectid order by b.jobid asc", conn);
SqlDataAdapter da = new SqlDataAdapter(select);
DataSet ds = new DataSet();
conn.Open();
da.Fill(ds);
conn.Close();
Table table = new Table();
foreach (DataRow dr in ds.Tables[0].Rows)
{
TableRow tr = new TableRow();
for (int i = 0; i < dr.ItemArray.Length; i++)
{
TableCell tc = new TableCell();
tc.Text = dr.ItemArray.GetValue(i).ToString();
tc.BackColor = Color.White;
if (dr.ItemArray.GetValue(8).ToString() == "COMPLETE")
{
tc.BackColor = Color.BlueViolet;
}
tr.Cells.Add(tc);
}
table.Rows.Add(tr);
}
foreach (TableRow tablerow in table.Rows)
{
TableCell newtc = new TableCell();
Button mybutton = new Button();
newtc.Controls.Add(mybutton);
mybutton.Text = "details";
//set the event here
tablerow.Cells.Add(newtc);
}
Panel1.Controls.Add(table);
DataBind();
View 2 Replies
View Related
May 16, 2006
I know how to get the events that start say on May, and I know how to get the events that end on May, however, How would I get the events that start on January and end in July. The month of May should display that event too.
so far, as an example, I have: SELECT
Events.startDate,
Events.endDate
FROM Events
WHERE
Events.Active = 1
AND
startDate BETWEEN convert(smalldatetime, '5/1/2006') AND convert(smalldatetime, '5/31/2006')
ORDER BY Events.startDate ASC; thank in advance.
View 3 Replies
View Related
Apr 29, 2004
I am not sure if I have posted something about this, but I can't believe there is not a single person out there that is using a procedure written in SQL in order to schedule sending of an email, if data hasn't been submitted.
I have had some hits and some help from some people but I am pretty much still stuck.
How is everybody else doing these sorts of thing,scheduling an email to be sent to a user if he/she hasn't submitted data,somebody must be doing it?
A sample, help ,anything???
Regards
View 12 Replies
View Related
Jul 23, 2005
I am tracing a SQL Server 2000 production server that gets a queryabout every second. The Event I chose to watch was "Lock:Timeout". Tomy surprise I see many of these come through the trace. Is this normalbehavior? What is "Lock:Timeout" showing me?Thanks,John
View 2 Replies
View Related
Mar 5, 2007
Hi,I am trying to debug some queries that are being generated by anexternal program, and I have no way of finding out what the actualsyntax of the query is from within the program itself. This means thatwhen the query fails I am left with only a very unhelpful message.So what I was wondering, was whether there is a way that I can view theactual queries that are sent to SQL server as they happen, or if areal-time solution doesn't exist, then some way I can look back afterthe event and see the syntax of the queries?Ideally, what I would like to do is see the queries in the form theywere sent to the server, ie "SELECT * FROM foo WHERE bar='foobar'", asthis would help me to figure out where the generated queries are goingwrong.Cheers,--Dylan Parryhttp://electricfreedom.org | http://webpageworkshop.co.ukThe opinions stated above are not necessarily representative ofthose of my cats. All opinions expressed are entirely your own.
View 5 Replies
View Related
Jul 20, 2005
Hiwe are considering porting an application from Ingres to SQL Server.Part of the application uses a feature of Ingres called databaseevents. These allow a application to monitor for an event happening inthe database, e.g. a user enters a record meeting certain conditions,the database raises an event including a record ID, and a clientapplication sees the event (without continual explicit polling), readsthe new record and starts processing it.Any idea what the equivalent functionality would be in SQL Server2000, or are applications simply not done that way?TIAChloe CrowderThe British Library
View 5 Replies
View Related
Jul 20, 2005
I'm trying to add functionality to a VB 6 application allowingcustomer service to add a customer number to a new customer.Customers are added to the database by sales personnel, and aprospective customer may have multiple rows due to projected ordersfor multiple products. Customer numbers are assigned when a newcustomer makes their first order.I'm using a DataGrid connected to an ADO Data Control. The datacontrol is connected to a view in SQL Server using the 'distinct'directive (I know it's not updatable) to show only one line per newcustomer. What I wish to do is capture the update event (probablythrough the FieldChangeComplete routine of the data control), manuallyassign the newly entered customer number to all appropriate rows inthe database, and cancel the update event with no notifications.I'm having two problems:1. I can't capture the newly entered customer number. The Textproperty of the DataGrid returns the old value of the cell instead ofthe newly entered value. How do I get the edited value?2. Even though I set adStatus = adStatusCancel in theFieldChangeComplete routine, I get a Microsoft DataGrid Control dialogstating 'Operation was Canceled'. How do I avoid this notification?
View 1 Replies
View Related
Feb 13, 2006
How is everyone using the logging features of SSIS? What events are relevant to day-to-day operation? Currently we are logging all events except for Diagnostic to a SQL table, and then using event log reporting. What would be the appropriate events used for a production environment?
View 1 Replies
View Related
Jun 17, 2015
Need calculating the count of events on each day. I have an event log table as shown below.
DECLARE @EventLog TABLE ( event_id int, status_id varchar(20) , dttm datetime )
INSERT INTO @EventLog
SELECT '100','Inplace','01/05/2015 05:00' UNION ALL
SELECT '100','Removed','03/05/2015 10:00' UNION ALL
SELECT '100','Inplace','05/05/2015 10:41' UNION ALL
[Code] ....
I need an output to look like on each day how many events were in place.
E.g.: for the month on May , Event_id 100 was inplace on 1st and removed on 3rd , so on 1st may 2 event_ids (100, 103) hence 2 .
event_ids - 103 / 104 and inplace the whole month and not removed. so its calculated the count as 2 til towards teh end of the month.
So I need to count of all each event_id in place for each day in may.
How to calculate the missing dates to ...
View 7 Replies
View Related
Sep 6, 2007
Hi,
Ive been taking a look at how to consume events from a package when executing programatically.
Ive got some code (copied below) that creates a package programatically, adds a sequence container then within that adds a script task , then executes it using the overloaded method of Package.Execute() that takes an IDtsEvents argument.
My class that implements IDtsEvents simply output a message to the console for each event type.
Weird thing is, when I execute, this is the only output I get:
Starting...
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Package
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Sequence
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.TaskHost
OnPostValidate:Microsoft.SqlServer.Dts.Runtime.TaskHost
OnQueryCancel
Package ran successfully
What I find weird is that I dont get information for loads of other event types. I would at least have expected to see some OnPostExecute events.
Anyone know why i dont see all of the events?
Thanks
Jamie
Heres the code:
Code Snippet
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.ScriptTask;
namespace Package_API
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting...");
Package p = new Package();
p.InteractiveMode = true;
p.OfflineMode = true;
// Add a Script Task to the package.
Sequence s = (Sequence)p.Executables.Add("STOCK:Sequence");
TaskHost taskH = (TaskHost)s.Executables.Add("STOCK:ScriptTask");
// Run the package.
DtsEvents events = new DtsEvents();
p.Execute(null,null,events,null,null);
//p.Execute();
if (p.ExecutionResult == DTSExecResult.Failure || p.ExecutionStatus == DTSExecStatus.Abend)
Console.WriteLine("Package failed or abended");
else
Console.WriteLine("Package ran successfully");
Console.ReadLine();
}
}
}
// Class that implements the IDTSEvents interface:
public sealed class DtsEvents : IDTSEvents
{
void IDTSEvents.OnPreExecute(Executable exec, ref bool fireAgain)
{
Console.WriteLine("OnPreExecute: " + exec.ToString());
}
void IDTSEvents.OnBreakpointHit(IDTSBreakpointSite breakpointSite, BreakpointTarget breakpointTarget)
{
Console.WriteLine("OnBreakpointHit");
}
void IDTSEvents.OnCustomEvent(TaskHost taskHost,string eventName,string eventText,ref Object[] arguments,string subComponent,ref bool fireAgain)
{
Console.WriteLine("CustomEvent");
}
void IDTSEvents.OnPreValidate(Executable exec, ref bool fireAgain)
{
Console.WriteLine("OnPreValidate: " + exec.ToString());
}
void IDTSEvents.OnPostValidate(Executable exec, ref bool fireAgain)
{
Console.WriteLine("OnPostValidate:" + exec.ToString());
}
void IDTSEvents.OnWarning(DtsObject source,int warningCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)
{
Console.WriteLine("OnWarning");
}
void IDTSEvents.OnInformation(DtsObject source,int informationCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError,ref bool fireAgain)
{
Console.WriteLine("OnInformation");
}
void IDTSEvents.OnPostExecute(Executable exec, ref bool fireAgain)
{
Console.WriteLine("OnPostExecute");
}
bool IDTSEvents.OnError(DtsObject source,int errorCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)
{
Console.WriteLine("OnError");
return true;
}
void IDTSEvents.OnTaskFailed(TaskHost taskHost)
{
Console.WriteLine("OnTaskFailed");
}
void IDTSEvents.OnProgress(TaskHost taskHost,string progressDescription,int percentComplete,int progressCountLow,int progressCountHigh,string subComponent,ref bool fireAgain)
{
Console.WriteLine("OnProgress");
}
bool IDTSEvents.OnQueryCancel()
{
Console.WriteLine("OnQueryCancel");
return true;
}
void IDTSEvents.OnExecutionStatusChanged(Executable exec,DTSExecStatus newStatus,ref bool fireAgain)
{
Console.WriteLine("OnExecutionStatusChanged");
}
void IDTSEvents.OnVariableValueChanged(DtsContainer DtsContainer,Variable variable,ref bool fireAgain)
{
Console.WriteLine("OnVariableValueChanged");
}
}
View 4 Replies
View Related
Nov 16, 2006
I ran into a pretty bizzare behavior in SSIS:
I am trying to set up a package with a built-in auditing. It has a OnPreExecute, OnPostExecute and OnError event handlers. I am trying to record when the package starts, completes, and the completion status. Each one of these event handlers has a script task that does the logging. I put in debug message boxes into each event handler script to understand what goes on. So here's the sequence of events:
1. When starting the package the OnPreExecute event fires. Right away it fires the second time. I'm guessing what happens here is the script task within the event handler fires its own OnPreExecute event - that's how the first message really pops up. The second message is generated by the actual package-level OnPreExecute event.
2. I have a condition within the OnPreExecute event handler which might set the task status to failure. You would expect the OnError handler to fire, right?.. Wrong! The package dies without firing either OnError or OnPostExecute event....
3. If i remove the condition in step 2, and force an error in the package body, i get an OnError event, and then 2 OnPostExecute events ( i guess for the same reason as in step 1).
What I'm trying to understand is why in the world my OnPreExecute and OnPostExecute events get fired by their own event handlers, yet when i fire other events within these event handlers the appropriate (other) event handler does not run.
Any ideas will be greatly appreciated.
View 9 Replies
View Related
Sep 1, 2006
Hi everyone,
I was wondering what kind of events fires when you do a LoadFromSqlServer method??? I've got defined a Events class but debugging with F11 never get in touch with any event (apparently or mabye the problem
is that I haven't declared that concrete one)
Let me know if possible or not. I provide you my snippet of code:
Dim pkg As New Microsoft.SqlServer.Dts.Runtime.Package 'Para que no choque con el objeto APPLICATION DE SYSTEM.WINDOWS.FORMS
Dim app As New Microsoft.SqlServer.Dts.Runtime.Application
Dim EventsSSIS As Eventos
EventsSSIS = New Eventos()
..
..
pkg = app.LoadFromSqlServer(ObjSSIS.sRutaDts & "" & ObjSSIS.sSSISName, ObjSSIS.sServer, "usrSSIS", "aaa", EventsSSIS)
..
..
Public Class Eventos
Implements IDTSEvents
OnTaskFailed(ByVal taskHost As TaskHost) Implements IDTSEvents.OnTaskFailed
OnWarning(ByVal source As DtsObj
OnPreValidate
..
..
Thanks in advance,
View 4 Replies
View Related
Sep 25, 2006
Hi everyone,
I was wondering when events inside IDTSComponentEvents interface are called when you throw a SSIS package? I've got a private class which implements IDTSEvents and along with that got another one that implements the IDTSComponentEvents. I see how neither of them are fired when I debug the code by using F11, and I don't know what is it for.
Let me know your comments or come back to me if you need further details on that.
Thanks in advance,
View 4 Replies
View Related
Feb 27, 2008
Hi all - so I know how to raise a custom event or information message from a script. It this the only way it can be done. I'd like to throw an informative message when a package starts, grab that in the event handler and send out email message when the package starts and when it finishes. I would like to pass on some of the variables of the package so custom would be the choice. I know if I throw a scipt in there I can send oninformation, onerror, onwarning but can it be done any other way
thanks
View 5 Replies
View Related