Showing posts with label handle. Show all posts
Showing posts with label handle. Show all posts

Saturday, February 25, 2012

Capturing Error Information

Question #1
Is there a way to get a handle on the context of an error within an Error Handler for a task, containter, or package?

ie:
I am looking to log(Custom logging using script task not Log provider) error information, code, stack, etc. from a task or container that fails due to an unhandled exception. When the exception is handled using OnError event handler, I don't get the context of the task or the container.

Question #2
Is there a reason why Pre and post execute events for a package get executed several times? I have a script task that logs pre/post package information into our db, however, everytime I run the package in debug mode, it logs 5 - 10 messages into the DB for pre/post events. Don't these events ONLY fire once per package?

for #1 see
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=86691

for #2 see
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=86608|||Thank you for the reply. The #2 is answered, however, for #1, what if I don't have logging configured. In this scenario the exception will be lost and logged to the DB.

Is there a way, I can pick up the context of the error from OnError Event handler? or do I have to look at the Db for an error?|||

N.S. wrote:

Thank you for the reply. The #2 is answered, however, for #1, what if I don't have logging configured. In this scenario the exception will be lost and logged to the DB.

Is there a way, I can pick up the context of the error from OnError Event handler? or do I have to look at the Db for an error?

What exactly do you mean by the "context of the error". The OnError event handler provides the error message and information about the container that raised the error so it s obviously something other than those.

-Jamie|||

By Context of the error, I mean the actual error message and error code for the container that raised OnError event.

Within OnError event handler, if I add a script task, how can I retrieve the actual error message and error code? Are there System variables that I can use within the script to get that information? Thanks.

Friday, February 24, 2012

Capture name of stored procedure within itself?

Is there any way of capturing the name of a stored procedure during
execution?
I've created a generic stored procedure to handle much of my error
handling. I would like to be able to have the calling stored
procedure to pass its name as one of the parameters to the error
handling proc to be logged on certain error messages events.
I could easily hard code the stored procedure name on all of the
calls, but I am trying to create a series of generic code blocks to
add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
ETC), so I was hoping to find a function or create a function that
would give the name of the proc.
Any thoughts would be appreciated.
SELECT OBJECT_NAME(@.@.PROCID) AS ProcName
"Sean O'Thule" <othule@.hotmail.com> wrote in message
news:63840202.0408300912.2d9c1f2c@.posting.google.c om...
> Is there any way of capturing the name of a stored procedure during
> execution?
> I've created a generic stored procedure to handle much of my error
> handling. I would like to be able to have the calling stored
> procedure to pass its name as one of the parameters to the error
> handling proc to be logged on certain error messages events.
> I could easily hard code the stored procedure name on all of the
> calls, but I am trying to create a series of generic code blocks to
> add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
> ETC), so I was hoping to find a function or create a function that
> would give the name of the proc.
> Any thoughts would be appreciated.
|||Great, thanks

Capture name of stored procedure within itself?

Is there any way of capturing the name of a stored procedure during
execution?
I've created a generic stored procedure to handle much of my error
handling. I would like to be able to have the calling stored
procedure to pass its name as one of the parameters to the error
handling proc to be logged on certain error messages events.
I could easily hard code the stored procedure name on all of the
calls, but I am trying to create a series of generic code blocks to
add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
ETC), so I was hoping to find a function or create a function that
would give the name of the proc.
Any thoughts would be appreciated.SELECT OBJECT_NAME(@.@.PROCID) AS ProcName
"Sean O'Thule" <othule@.hotmail.com> wrote in message
news:63840202.0408300912.2d9c1f2c@.posting.google.com...
> Is there any way of capturing the name of a stored procedure during
> execution?
> I've created a generic stored procedure to handle much of my error
> handling. I would like to be able to have the calling stored
> procedure to pass its name as one of the parameters to the error
> handling proc to be logged on certain error messages events.
> I could easily hard code the stored procedure name on all of the
> calls, but I am trying to create a series of generic code blocks to
> add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
> ETC), so I was hoping to find a function or create a function that
> would give the name of the proc.
> Any thoughts would be appreciated.|||Great, thanks

Capture name of stored procedure within itself?

Is there any way of capturing the name of a stored procedure during
execution?
I've created a generic stored procedure to handle much of my error
handling. I would like to be able to have the calling stored
procedure to pass its name as one of the parameters to the error
handling proc to be logged on certain error messages events.
I could easily hard code the stored procedure name on all of the
calls, but I am trying to create a series of generic code blocks to
add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
ETC), so I was hoping to find a function or create a function that
would give the name of the proc.
Any thoughts would be appreciated.SELECT OBJECT_NAME(@.@.PROCID) AS ProcName
"Sean O'Thule" <othule@.hotmail.com> wrote in message
news:63840202.0408300912.2d9c1f2c@.posting.google.com...
> Is there any way of capturing the name of a stored procedure during
> execution?
> I've created a generic stored procedure to handle much of my error
> handling. I would like to be able to have the calling stored
> procedure to pass its name as one of the parameters to the error
> handling proc to be logged on certain error messages events.
> I could easily hard code the stored procedure name on all of the
> calls, but I am trying to create a series of generic code blocks to
> add to the stored procedures (one for simple SELECTS, UPDATE, INSERTS,
> ETC), so I was hoping to find a function or create a function that
> would give the name of the proc.
> Any thoughts would be appreciated.|||Great, thanks

Thursday, February 16, 2012

Capabilities of Developer Edition

Hi there,

Forgive me if this has been asked & answered a million times, but I'm trying to get a handle on whether, if I purchased a copy of SQL Server 2000 Developer Edition, it would meet my needs or not.

A long-standing client of mine just called me to ask if I could help her out on a database project. I would be working offsite, so I'd need to pony up the cash to buy software for my own computer, basically.

I keep reading that the DE has "limited functionality" but I can't seem to find details on what those limitations are. Is it the sort of deal where it can do everything I need for development (using Enterprise Manager/Query Analyzer to connect to a db either across the internet or maybe on VPN, and doing your usual EM/QA things from there) but I couldn't run it as a server? Or is there actual functionality that's missing?

If there's just a link I've overlooked that answers my question, I'd appreciate someone pointing it out. Thanks!Here's a good place to see the differences: http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/reskit/sql2000/part2/c0361.asp.|||That page is perfect! Thanks for pointing it out.

Next silly question: why does compusa.com and some other online outlets list SQL Server Developer Edition for forty-something dollars when most offer it for four hundred-something dollars? Would paste the URL to the Epinions search result, but the forum code is sticking a break tag in the middle of it, which breaks the link.

That can't be right, can it? I suspect not, as all the places I found at Epinions listing the low price are all out of stock.

Thanks.|||Should Google before posting. I just answered my own question. Apparently they've cut the price:

http://www.entmag.com/news/article.asp?EditorialsID=5895

So now the question becomes: why do only 4 of 21 stores Epinion has prices for have the new low price? Am I to pay five hundred bucks if I happen to need it now? ... purely rhetorical question, that.|||Can you believe it? Even shop.microsoft.com has it on backorder. I called their customer service line to ask about it, and after the rep tried to convince me that there was no such thing as a SQL Server 2000 Developer Edition, he was finally able to give me an estimated ship date of September 8.

sigh.