Reputation: 1913
The scenerio is:
I have an Sql server 2008. When an event occur in DB the database should inform the windows service which should do some action.
I don't want to wait in the interval for the new tasks/db events to do something. I need an immediate action.
What is the best approach to do this?
I thought about making a CLR assembly and linking it to the DB. The assembly then should connect to the windows service using e.g. tcp/ip Then the service is awaken and do the job
Or create a local inproc com assembly and load it from db
Thanks in advance for all the tips.
Upvotes: 0
Views: 232
Reputation: 22001
I'd create a windows service that includes a SqlDependency
.
It functions a bit like a FileSystemWatcher
, but for a sql database.
http://msdn.microsoft.com/en-gb/library/a52dhwx7(v=vs.80).aspx
Upvotes: 2