Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Thursday, March 29, 2012

Do SQL Server 2005/CLR Triggers support .config Files?

Does anyone know if it's possible to use the standard .config file within a CLR Trigger to read properties via the System.Configuration namespace

I guess it's not possible because the CLR Trigger needs to be compiled as an assembly which is hosted by SQL Server

Thanks

Jason

Hi,

http://groups.google.de/group/microsoft.public.sqlserver.programming/browse_frm/thread/6d635c2cd23fed7

CLR stuff in SQL Server does not work like those know from "normal" applications. Although you can use the Configuration class to load a configuration somewhere stored on disk, you have to keep in mind, that every namespace / class that you use with are not approved as safe will lower down your security, because you have to mark them as unsafe / external access.

Perhaps any other posters has some other experiences about that.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||Hi,
I think the “CLR Triggers for SQL Server 2005” article on
http://aspalliance.com/1273_CLR_Triggers_for_SQL_Server_2005
may be helpful in this discussion.

This popular white paper is written by a software engineer from our organization Mindfire Solutions (http://www.mindfiresolutions.com).

I hope you find it useful!

Cheers,
Byapti

Thursday, March 22, 2012

Do I HAVE to specify configuration files in dtexec

Hi,
I have a package that uses configurations and when I run from SSIS Designer it picks up the config files without any problem.

When I run it from dtexec...it doesn't.

Do I have to specify the config files that the package should use even though I have already defined them in the package?

If the answer is "Yes", how do I tell it that the location of the configuration file is stored in an environment variable cos dtexecui doesn't provide an interface to let you do that?

-JamieJamie,

You should not have to specify it as the package should be set up to use the config file. I know this is a stupid question but did you verify that the environment variable was available in the command prompt from which you ran DTExec from? If you did then please file a bug.

As a workaround you can specify a config file from the command line using the config option with the config filename (you can not use an environment variable from the command line).

Thanks,
Matt|||I think I've bottomed this one out.

I came in this morning and the package in question is now working. Strange!!

However, I think I know why. I knocked up a quick repro and saw that the env variable was not available to the command line. As soon as I logged out and back in again it was there.

So it sounds like a Windows "funny". I'm on Win2k3 by the way.

Anyway, it works. Thanks for the tips Matt.

-Jamie