Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Can I set a session variable from an MS SQL
Old 07-19-2008, 01:04 PM Can I set a session variable from an MS SQL
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
I want to use a trigger to set a web server session variable to indicate if a users table has changed. I have this SQL so far...

"CREATE TRIGGER Alert ON usertable AFTER INSERT, UPDATE, DELETE AS statements GO"

Is this even possible?
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-19-2008, 04:18 PM Re: Can I set a session variable from an MS SQL
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nope.

SQL server has NO interaction with the webserver
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-23-2008, 08:49 PM Re: Can I set a session variable from an MS SQL
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Quote:
Originally Posted by chrishirst View Post
SQL server has NO interaction with the webserver
Dude! It's a brave new world out there. You need to play with .NET!

To answer the original question, sure, absolutely, you can use a trigger to change a session variable. There's a little bit of complexity involved, and a definite performance hit. But it can absolutely be done, and this is better than polling.
  1. Expose a web service that lets your session variable be modified on demand.
  2. Create a SQL CLR (aka .NET) stored procedure that calls the web service.
  3. Call this stored procedure from your trigger.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can I set a session variable from an MS SQL
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31764 seconds with 12 queries