locked
Monitoring a SQL Server table's data using vb.net.. RRS feed

  • Question

  • Hi,

     

    I have a job in my sql server which will execute every second and insert some data for me in my table. Now, I need to do vb.net application to check whether checkouttime column in that table got data or not and if there is data then I need to get the id of that row.

     

    How can I monitor my table's data to check whether that column got data or not.

     

    Thanks,

     

    Regards,

    Bobby


    Ayyagari
    Tuesday, August 2, 2011 6:20 AM

Answers

All replies

  • If any one don't understand my question please let me know. I will elaborate my question.

     

    Thanks,

     

    Regards,

    Bobby


    Ayyagari
    Tuesday, August 2, 2011 9:17 AM
  • Hello Bobby,

    Thanks for your post.

    I recommend you could try to use the SqlDependency Class which uses the Service Broker to receive messages from the database engine.

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldependency.aspx
    (SqlDependency Class)

    Below article is about how to use the SqlDependency class and Query notifications to monitor SQL Server 2005 database data changes. Query Notifications allow an application to be notified when data has changed in the database. Please check. Hope it could make you get some ideas.

    http://www.dreamincode.net/forums/topic/185244-using-sqldependency-to-monitor-sql-database-changes/
    (Using SqlDependency To Monitor SQL Database Changes)

    If you have any concerns, please feel free to follow up.

    Have a nice day.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Marked as answer by Liliane Teng Tuesday, August 9, 2011 3:35 PM
    Friday, August 5, 2011 2:34 PM
  • Hi Liliane Teng,

     

    Thanks for your reply and sorry for my late reply.

     

    I will try it out the method which u have mentioned. But, I am using SQL Server 2000 (MSDE). Will that have that option??

     

    Thanks,

     

    Regards

    Bobby


    Ayyagari
    Wednesday, August 10, 2011 1:43 AM
  • Hi Bobby,

    I feel very sorry. SQL Server 2000 may not have that option. Query notifications were introduced in Microsoft SQL Server 2005.  Is it convenient for you to upgrade SQL Server 2000 to SQL Server 2005? If so, please check:

    http://msdn.microsoft.com/en-us/library/ms144245(v=SQL.90).aspx (Upgrading to SQL Server 2005)

    You could also try SQL Server Setup & Upgrade forum for more suggestions.

    If you have any concerns, please feel free to follow up.

    Have a nice day.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 10, 2011 2:22 AM
  • Hi,

     

    May customer would not allow for an upgrade. For instance, i am using files. I am writing a text file once there is a data get inserted and my front end application will monitor that text file.

     

    Is this process recommended?? As of time constraint, I have done in that way but not sure whether is efficient method.

     

    Thanks,

     

    Regards,

    Bobby


    Ayyagari
    Wednesday, August 10, 2011 4:09 AM
  • Hi Bobby,

    Maybe you could try to use similar Change Tracking method. Please check the second reply on below link:

    http://stackoverflow.com/questions/342031/net-sql-server-database-monitoring-insert-update-delete (.Net SQL Server Database Monitoring - Insert, Update, Delete)

    "If you want to achieve this in 2005 or below, you can basically create tables for each table you want to be tracked and have a trigger to insert values into the tracking table on insert, update, delete. Then have a process to clear this down. This is basically what Change Tracking does for you."

    About this issue, I recommend you could try SQL Server Forums for more better suggestions. More SQL Server experts live there. Thanks for your understanding.

    Have a nice day.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 10, 2011 7:05 AM
  • Hi Liliane Teng,

     

    Thanks for your kind suggestion.

    I will post in SQL Server Forums as you mention.

     

    Thanks,

     

    Regards,

    Bobby


    Ayyagari
    Thursday, August 11, 2011 6:33 AM