March 1, 2009 at 1:02 am
Hello,
I'm using CLR triggers to write a XML file in folder in the file system to trigger a windows service with a FileSystemWatcher But when using the StreamWriter Class a security exception raised!
How can I over come this problem?
March 1, 2009 at 7:15 am
has the clr proc been granted external access ?
Personally, I wouldn't put that kind of stuff in a trigger.
A trigger is in process context, so if the trigger fails, the transaction fails,...
You may be better off shipping this functionality to a service broker application or another way of asynchrone processing.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
March 2, 2009 at 6:40 am
Let me second ALZDBA's opinion. Any action that requires access to resources outside the database should not be in a trigger, but should use Service Broker or some other asynchronous method of processing.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
March 2, 2009 at 8:31 am
I have an example of how to do this in my code Camp Presentation Kit "The Top 10 Reasons You Aren't Already Using Service Broker" at my blog site, here.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply