Wednesday, March 28, 2012
Precedence Question: domain vs local password policy
CHECK_EXPIRATION and CHECK_POLICY set to ON, which password plicy will take
effect if there is both a local policy on that server and a domain policy
affecting that server? Generally, domain policy will take precedence over a
local policy, but SQL2K5 does not address this detail and which will take
effect. I've hunted down lots of documentation, but none of it seems clear.
Thanks.SQL Server doesn't deal with this issue. It simply hits the security API.
The domain policy will override the local policy which is by design in
Windows. SQL Server simply abides by what Windows enforces.
Mike Hotek
MHS Enterprises, Inc
http://www.mssqlserver.com
"DisgruntledTechGuy" <DisgruntledTechGuy@.discussions.microsoft.com> wrote in
message news:12CC258C-C990-47C0-A36D-6EEC39E42A03@.microsoft.com...
> When running SQL2K5 on W2K3 and creating a sql server login w/ both
> CHECK_EXPIRATION and CHECK_POLICY set to ON, which password plicy will
> take
> effect if there is both a local policy on that server and a domain policy
> affecting that server? Generally, domain policy will take precedence over
> a
> local policy, but SQL2K5 does not address this detail and which will take
> effect. I've hunted down lots of documentation, but none of it seems
> clear.
> Thanks.|||Thanks Mike. That's what I figured, but documentation out there was ambiguo
us.
"Michael Hotek" wrote:
> SQL Server doesn't deal with this issue. It simply hits the security API.
> The domain policy will override the local policy which is by design in
> Windows. SQL Server simply abides by what Windows enforces.
> --
> Mike Hotek
> MHS Enterprises, Inc
> http://www.mssqlserver.com
>
> "DisgruntledTechGuy" <DisgruntledTechGuy@.discussions.microsoft.com> wrote
in
> message news:12CC258C-C990-47C0-A36D-6EEC39E42A03@.microsoft.com...
>
>sql
Precedence puzzle
Hello folks,
I have probably a dumb newbie question but I can't find the answer anywhere.
On my Control Flow design pane I have two objects: a SQL task object and a Data flow task object. The first 'points' to the second. From my digging I believed that by indicating with the arrow from 1 to 2 that 1 would execute to finish before 2 was started.
My SQL taks is to truncate a table to receive the new data coming from the data flow task object. Instead 2 executes first and then 1. You can imagine producing an empty table was not my goal for this package.
Can anybody give me a clue?
Thanks....
Jim
That's very strange. If there is a precedence constraint pointing FROM the Exec SQL Task TO the Data-flow Task then the Exec SQL Task should execute first.
Are you sure that is how it is setup?
-Jamie
|||
Yes, that's the setup. Do you have to do anything other than drag the arrow from the Execute SQL Task to the Data Flow Task in order for precedence to be followed?
Jim
|||Are you sure they are executed in this order? How do you determine this?I would try setting pre-execute breakpoint in designer (select the task, click F9, repeat for second task) and see what is the execution order, what happens to the tables after each step, etc.|||
Two clues tell me the steps are running out of order. First watching the process pane as it executes always shows the SQL task executing second and the end result of the package run is an empty data set.
I will try the break point to see what happens. Thanks for the tip.
|||Unfortunately, progress pane can be confusing. It groups the events from tasks under one node, and the order is determined by the order of the first events from the task. So if data flow task is validated first, it will appear above the SQL task (the validation order is not affected by precedence constraints).|||Just curious. Does your source table have any data?Make sure its not empty.|||
That sounds like what I was seeing and just got paranoid. I set break pionts as suggested in an earlier post and confirmed the order of execution.
Thanks to all for your help!
Precedence of MAX and WHERE
I'd like to create a query which returns the MAX of a group of dates so long
as the number is less than a given date. For example :
SELECT MAX(date), username
FROM mydatatable
WHERE date < '01/01/2005'
GROUP BY username
Will this do what I expect and return the username and date which is the
most recent before 01/01/2005 ?
Thanks
AndrewHi,
Your query looks good.
Thanks
Hari
SQL Server MVP
"Andrew Webb" <andrew.webb@.eme-med.co.uk> wrote in message
news:OTlNYqfuFHA.1572@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'd like to create a query which returns the MAX of a group of dates so
> long as the number is less than a given date. For example :
>
> SELECT MAX(date), username
> FROM mydatatable
> WHERE date < '01/01/2005'
> GROUP BY username
>
> Will this do what I expect and return the username and date which is the
> most recent before 01/01/2005 ?
> Thanks
> Andrew
>|||You could compare these queries and see which one yields the results you
want. Word problems are tough to solve, usually better to provide specs as
described in http://www.aspfaq.com/5006 . Also, "date" is a really bad name
for a column. Not only is it a reserved word, it is also very tough to
decipher it... date of WHAT? Finally, do not use m/d/y or d/m/y date
formats when hard-coding date strings. The safest approach here is to use
YYYYMMDD format, then this can't be
by software or humans.CREATE TABLE dbo.myDataTable
(
username VARCHAR(32),
eventDate SMALLDATETIME
)
GO
SET NOCOUNT ON
INSERT myDataTable SELECT 'bob','20040101'
INSERT myDataTable SELECT 'bob','20050201'
INSERT myDataTable SELECT 'frank','20040101'
INSERT myDataTable SELECT 'frank','20040725'
GO
SELECT username, MAX(eventDate)
FROM dbo.myDataTable
WHERE eventDate < '20050101'
GROUP BY username
SELECT username, MAX(eventDate)
FROM dbo.myDataTable
GROUP BY username
HAVING MAX(eventDate) < '20050101'
GO
DROP TABLE dbo.myDataTable
GO
"Andrew Webb" <andrew.webb@.eme-med.co.uk> wrote in message
news:OTlNYqfuFHA.1572@.TK2MSFTNGP10.phx.gbl...
> Hi
> I'd like to create a query which returns the MAX of a group of dates so
> long as the number is less than a given date. For example :
>
> SELECT MAX(date), username
> FROM mydatatable
> WHERE date < '01/01/2005'
> GROUP BY username
>
> Will this do what I expect and return the username and date which is the
> most recent before 01/01/2005 ?
> Thanks
> Andrew
>|||Andrew,
> Will this do what I expect and return the username and date which is the
> most recent before 01/01/2005 ?
It is correct, but it could be more than one. It will select each username
and the max date for those username with date values less than '20050101'. I
f
a username does not have date values in this range then it will not appear i
n
the result.
AMB
"Andrew Webb" wrote:
> Hi
> I'd like to create a query which returns the MAX of a group of dates so lo
ng
> as the number is less than a given date. For example :
>
> SELECT MAX(date), username
> FROM mydatatable
> WHERE date < '01/01/2005'
> GROUP BY username
>
> Will this do what I expect and return the username and date which is the
> most recent before 01/01/2005 ?
> Thanks
> Andrew
>
>
Precedence Constraints and Sequence Containers
Double-click on one of the precendence constraints going into the single sequence container. Near the bottom you will see a drop down that allows you to set it to an OR condition (The constraints will turn into dotted lines)
This means that that will execute if ANY of its precedence cnstraints are satisfied. If you leave it set to AND, then ALL of the constraints have to be satisfied, which will never happen in your case since the other 11 sequence containers will never execute.
|||Thanks Dave!
I saw that but wasn't sure how that worked.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
sqlPrecedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
sqlPrecedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
Precedence Constraint in SSIS didn''t work
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
Try increasing the MaximumErrorCount property on the package. If it is 1, the package will fail as soon as an error is encountered.
Putting the script task in the OnError event handler for the ForEach container should work as well - what error are you getting when you try that?
|||Hi John,If I increased the MaximumErrorCount into a value larger than 1, is it effective to solve the problem ? we won't know whether the package gets an error.
I've tried put the Script task in the OnError/OnPostExecute event handler for the container or Data Flow task but when error occured (in Data Flow task) it didn't redirect to those event handler. Actually there is no error with the Script task in event handler. Or maybe there's property I need to set ?
John do you want a copy of my package ?
Best regards,
Hery|||
That would help. My email is in my profile.
|||Hi John,Have you got my email ? my network is a little bit slow I should try it many times. Sorry for waiting.
Best regards,
Hery|||
Looking at your package, none of your data flows are connected directly to the script task by an Error (red) constraint. You'll need that at a minimum, if you aren't using the OnError handler.
As an alternative, you could handle this error in the data flow (perhaps - haven't looked closely at the data) by redirecting error rows on the source in the data flow.
|||Hi John, Sorry I've been deleted the error precedence since it didn't work well. Actually there was an error precedence connected directly from Data Flow to Script task. I was ini hurry when emailed it to you. In the package you can use the container named Harga FeLC, perhaps you should change the folder location and source of flat file since I used variable for ConnectionString.
Thanks John.|||
Sorry it took so long to get back to you - real work intruded.
In testing your package, the OnError event handler is firing exactly as it should - when the data flow fails. The Script Task connected with a Failure precedence constraint to the data flow also ran successfully. However, since you have two constraints on the script task (one from the Data Flow and one from an Execute SQL task) you have to set the constraints to evaluate as OR rather than AND. If you select the properties for one of the constraints leading to the script task, set the LogicalAnd property to False.
If it is set to false, it means a failure in either preceding task will cause the Script Task to run. However, when it is set to true, both tasks have to fail for the Script Task to run. Since the Execute SQL Task will never run if the Data Flow task fails, this means the Script Task can never be executed.
|||Hi John,Sorry for waiting, I haven't try solution yet, maybe today I will and give the report tomorrow. How can I forget the property of the precedence...thanks for remind me John, I really forget about that. I think it will work.
One more question about OnError event handler, I've tried put the Script task inside Data Flow task but it didn't work, or maybe I should put it on the Container ?
Thanks in advance,
Best regards,
Hery|||
I tested it in the OnError event for the data flow, and it worked fine for me.
|||Hi John,I tested change the precedence constraint from AND to OR, and it works fine. Thanks you John.
There's a question related with Script task. Inside the script I grab a system variable, the code just like below :
Dim errDesc As String = Dts.Variables("System::ErrorDescription").Value.ToString()
but it gets an error description just like below :
Error: The script threw an exception: The element cannot be found in a collection. This error happens when you try
to retrieve an element from a collection on a container during execution of the package and the element is not there.
is it allowed to grab the system variable just like my code ? or I have to set something inside Script Editor properties ?
About OnError event handler, I've tried to put it on Data Flow task event but nothing happen. Maybe you can check the package from me. Inside the Data Flow task of Harga FeLC container there's a Script task I've put on OnError event. Is there any setting that I have to do John ? Here is the capture of my OnError event handler and I put it on Data Flow task.
Thanks for your help John, I appreciate it so much.
Best regards,
Hery|||
On the variable issue - you need to lock it before reading it, and unlock it after. Here's a post that has more information - http://www.developerdotstar.com/community/node/512.
I tested having a Script task in the OnError handler for the data flow, and it ran without any problems. When you say nothing happens, have you looked at the event handler in the debugger while the package is running to see if it is called? It should turn green or red.
sqlPrecedence Constraint Expressions
Hi all
I've got a package that checks the length of chars in a flatfile and if it's correct it executes the dataflow task.
How can i write an expression in the precedense constraint editor to skip the dataflow task if there is an error in the script task?
Thank you
Set a variable in the script task and then test the variable in the precedence constraint.|||Something similar to:
Code Snippet
If [File is Valid condition] Then
Dts.Variables.Item("User::ValidFile").Value = 1
Else
Dts.Variables.Item("User::ValidFile").Value = 0
End If
in the script task (mark the variable as ReadWrite in the script task properties) and
Code Snippet
@.ValidFile==1
in the precedence constraint. You can set the expression by double-clicking the precendence constraint and choosing Expression and Constraint in the Evaluation operation property.
|||Thanks for all your help Phil and JWelch.
Precedence Constrains
Hi there!
I've a few tasks in my dataflow. Some of them are executed depending on an precedence constrain. Works fine.
The problem is following: I want to write a success message (execute SQL task), when all the tasks who have been executed have done this with success. For example, i ve ten tasks, and 2 of them are executed (successfully). This is good, i want to execute my task to write the success message.
I tried to set these precedence constraints with EvalOP = ExpressionOrConstraint, Values = Success and an expression, what returns TRUE, when the task above is not executed (the condition from a precedence constraint above). But the task to write my message will never be executed, because it seems the task does'nt give any result (neither success nor failure) when they ar not executed, and so my AND-Constraint for the success message task will only get TRUE, when ALL task are executed (and successful).
Is there any chance to get somethink like "isSuccess OR IsNotExecuted" into a precedence constraint?
Thanks, Torsten
Put all the tasks in a Sequence Container and then have a precedence constraint to the SQL Task with an on success constraint.|||I had the same idea, and it seems to be the only workaround. But in these way it is not possible to realize an individual errorhandling of each task.
I think i can live with that. Thanks a lot,
Torsten
Precedence "Completion" operation
I have three sequence containers setup to run in parallel. I have a final step that parses the log file and displays results, and I want to this to occur when all three containers have completed, success or failure. I therefore have a constraint from each container that feeds into my final step, and all three constraint types are set to "completion".
When I run the package and one of the tasks within a container fails (and fails its parent, but not the package) the final step is not executed.
If I take off all the constraints except one, the final step is executed as expected.
I am using checkpointing if that has any impact. Disabling it makes no difference.
Any thoughts/alternatives I might try?
thanks
not sure about this...but have looked at the MaximunErrorCount property at the package level?|||Post parallel tasks not excuting despite completion precedence constraints(s). This sounds like you're using FailPackageOnFailure. Are you?
If a task fails and you've sett FailPackageOnFailure on it, or something in its container hierarchy, the parallel tasks that have already started will still continue post failure. But, from the point the FailPackageOnError is hit, no other task will be started, including the task to which you've linked up the Completion precedence constraints.
FailPackageOnFailure trumps any constraint.
|||jaegd wrote:
FailPackageOnFailure trumps any constraint.
That was the problem. Removed that setting and now the constraints behave as expected.
Thanks a lot!