monitoring a table in sqlserver | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

monitoring a table in sqlserver

hi all,
is there any way for sqlserver to monitor a table?
i want to update some records in a table when the time is up.
there is a table with some fields (xID,xState,xDeadLine)
i want to update xState field with 1 value when the "GETDATE() >=xDeadline fields value" like this. s="UPDATE tableA SET xState=1 WHERE xDeadLine<=" GETDATE()
i want sqlserver to act this query?
i dont wanna write any dll or service cos sql server runs on a hosting firm.
(sqlserver must run the query.) thanx,
This can be accomplished by writing a update trigger on tableA. inside the trigger , you can execute the update statement when the condition is true. Revert in case of any queries.
regards, Chetan

The trigger won’t just fire automagically whenever the criteria is met Chetan. He would need a job to run periodically against the table and check for the condition. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.
it cant be done with trigger. trigger runs when the table is changed(update,delete,insert into).
i want sql server to check table when GETDATE()>=xDeadLine. i mean sql must always check the condition like timer in vb.
a friend told me notification server for sqlserver.but i dont know anything about it. can anyone help me about it?

You can schedule a job that runs code mentioned. Use SQL Server Agent if you have rights on the server. Expand MSSql Servers/<SQL Sever Group><dbServer>/management/sql server agent folder in Enterprise Manager and learn how to use it.
]]>