Showing posts with label failed. Show all posts
Showing posts with label failed. Show all posts

Tuesday, March 27, 2012

Determine Previous Task Executed

I have the failed path of many tasks pointing to a single Script Task that logs a failed entry into my database. In this script task, I need to be able to determine the task that faliled as I need to write a unique error message depending on the task that failed.

In my VB script, how would I determine which task was the one that failed?

Thank You!!!

a SSIS newbie

There is no way I can see to do that.

Have you investigated the logging available in SSIS before you write your own?

If you do want a task for additional error handling work, then try the on error event handler. Event handlers can host an entire workflow of tasks if you want, and are a better way of capturing this type of event compared to workflow constraints. You have some system variables scoped to the event handler that should give you all the information you want.

|||What I do is add a derived column to each error flow. Then in that derived column, I add a new column, ErrorReason (or whatever you like), which is where I store a small string of what the error was. So then in your script component, you could look at that column and act accordingly.

However, it sounds like you can do all of this outside of a script component. (You are inside the data flow, correct? I assume so because you talk of "failed paths.") If you're talking about a failed precedence constraint, then I'll defer to Darren above.|||

Hi AspUser123,

I agree with Darren.

Recently, I implemented a custom error logging mechanism for a client using the onError Event Handler. They wanted the package to continue executing, but capture information about each fault.

Since the Error events bubble, I implemented the entire custom logging solution in the Package onError Event Handler. You can use the SourceName system variable to identify the name of the task that originally generated the error - even if it's nested inside several layers of containers. You can also collect information such as the ErrorDescription and ErrorCode (error number).

In this case I ended up writing the information out to a SQL Server database for storage, reporting, and analysis - but you could easily implement a flat file output. You can use an Execute SQL Task (calling a stored procedure) to write to SQL Server, or add a Data Flow to the onError Event Handler to store the system variable values to a flat file destination.

Hope this helps,
Andy

|||I agree with Darren.

Friday, March 9, 2012

detach db failed due to ghost cleanup

hi
i'm trying to detach a database. However i cant as the db is in use. I can
kill any user processes but not the non-user process 'ghost cleanup'. Because
of this the db is in use and the detach cannot occur.
I realise what the process 'ghost cleanup' is there for - but surely it
shouldn't be in use permanently? (db options such as shrink db are not set on
this db). There any safe way to disable?
Try putting the database in single user mode by using the ALTER DATABSE with
SET SINGLE_USER mode option and then try detaching.
"Dunxz" wrote:

> hi
> i'm trying to detach a database. However i cant as the db is in use. I can
> kill any user processes but not the non-user process 'ghost cleanup'. Because
> of this the db is in use and the detach cannot occur.
> I realise what the process 'ghost cleanup' is there for - but surely it
> shouldn't be in use permanently? (db options such as shrink db are not set on
> this db). There any safe way to disable?
>
|||Thanks
"Pragya" wrote:
[vbcol=seagreen]
> Try putting the database in single user mode by using the ALTER DATABSE with
> SET SINGLE_USER mode option and then try detaching.
>
> "Dunxz" wrote:

detach db failed due to ghost cleanup

hi
i'm trying to detach a database. However i cant as the db is in use. I can
kill any user processes but not the non-user process 'ghost cleanup'. Becaus
e
of this the db is in use and the detach cannot occur.
I realise what the process 'ghost cleanup' is there for - but surely it
shouldn't be in use permanently? (db options such as shrink db are not set o
n
this db). There any safe way to disable'Try putting the database in single user mode by using the ALTER DATABSE with
SET SINGLE_USER mode option and then try detaching.
"Dunxz" wrote:

> hi
> i'm trying to detach a database. However i cant as the db is in use. I can
> kill any user processes but not the non-user process 'ghost cleanup'. Beca
use
> of this the db is in use and the detach cannot occur.
> I realise what the process 'ghost cleanup' is there for - but surely it
> shouldn't be in use permanently? (db options such as shrink db are not set
on
> this db). There any safe way to disable'
>|||Thanks
"Pragya" wrote:
[vbcol=seagreen]
> Try putting the database in single user mode by using the ALTER DATABSE wi
th
> SET SINGLE_USER mode option and then try detaching.
>
> "Dunxz" wrote:
>

detach db failed due to ghost cleanup

hi
i'm trying to detach a database. However i cant as the db is in use. I can
kill any user processes but not the non-user process 'ghost cleanup'. Because
of this the db is in use and the detach cannot occur.
I realise what the process 'ghost cleanup' is there for - but surely it
shouldn't be in use permanently? (db options such as shrink db are not set on
this db). There any safe way to disable'Try putting the database in single user mode by using the ALTER DATABSE with
SET SINGLE_USER mode option and then try detaching.
"Dunxz" wrote:
> hi
> i'm trying to detach a database. However i cant as the db is in use. I can
> kill any user processes but not the non-user process 'ghost cleanup'. Because
> of this the db is in use and the detach cannot occur.
> I realise what the process 'ghost cleanup' is there for - but surely it
> shouldn't be in use permanently? (db options such as shrink db are not set on
> this db). There any safe way to disable'
>|||Thanks
"Pragya" wrote:
> Try putting the database in single user mode by using the ALTER DATABSE with
> SET SINGLE_USER mode option and then try detaching.
>
> "Dunxz" wrote:
> > hi
> >
> > i'm trying to detach a database. However i cant as the db is in use. I can
> > kill any user processes but not the non-user process 'ghost cleanup'. Because
> > of this the db is in use and the detach cannot occur.
> >
> > I realise what the process 'ghost cleanup' is there for - but surely it
> > shouldn't be in use permanently? (db options such as shrink db are not set on
> > this db). There any safe way to disable'
> >
> >