Showing posts with label shed. Show all posts
Showing posts with label shed. Show all posts

Sunday, March 11, 2012

Access to variables in Custom Log Provider?

Hello,

I found one post from the past asking this question, but didn't see an answer, so I am hoping someone can shed some more light on it:

I am writing a custom log provider in C#. Is it possible give this custom log provider access to the variables collection (via a variabledispenser object)? First glance at the log provider classes would tell me that this is not possible, though I would like confirmation. Also, if I am correct in thinking it is not possible, what was the reason for leaving this out?

Thanks!

Indeed this does not appear to be possible. What is it you are trying to acheive? Some more info may help us evaluate this as a feature request for the future.

Donald

|||

Donald,

Thanks for the response. A brief explanation of my thought process below:

I have a package with a number of variables that are evaluated during package execution via property expressions. When a component of the package logs a warning or failure, I would like to be able to identify what state each variable was in at the time of that warning/failure. I had hoped to be able to create a custom log provider to log this information to a database along with the warning/failure message. If the VariableDispenser object was passed into the Log method of my custom log provider, I would be able to accomplish this.

Thanks again.

David

Thursday, February 16, 2012

Access Linked Server system function

Could anyone shed some light on the syntax of accessing system function on a linked server?

I'm trying to get the recovery models of databases on a linked. However using databasepropertyex locally generates wrong results.

e.g.

select databasepropertyex(name, 'recovery') RecoveryModel from [server/databasename].master.dbo.SysDatabases

I tried select [server/databasename].databasepropertyex(name, 'recovery') RecoveryModel from [server/databasename].master.dbo.SysDatabases

which does not work.

Thanks.

You cannot call a function directly from a linked server using the four part naming convention. You have to use a stored procedure to get the results.