sql problem

  • Hi,I have a question that maybe it like a scenario....in the network i want to know how i can write a CLR stored procedure(with c#) that can insert a record to the table????...and then after writing this stored procedure what should i do as an administrator that when i insert a record to the table all the clients can see this inserted record real time in the network??

    FIRST OF ALL THANKS SO MUCH FOR YOUR HELP.I RECENTLY UNDERSTAND THAT I CAN USE MESSAGING OR MSMQ FOR MY QUESTION BUT I DON'T KNOW ABOUT MSMQ AND WHAT SHOULD I DO???IF SOMEONE KNOW PLEASE TELL IT...THANKS IN ADVANCE

  • Well there's no reason to use CLR for this, just use SQL:

    INSERT INTO YourTable(ColumnA, ColumnB, ...)

    SELECT valueA, valueB, ...

    If you really need to do it from CLR in C#, then you would just execute the exact same SQL statements through the CLR context connection.

    As for making all of your network clients "see" it, that's an application issue.

    [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]

  • x198yn (8/29/2009)


    ... what should i do as an administrator when i insert a record to the table all the clients can see this inserted record ...??

    Nothing.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Hi x198yn

    x198yn (8/29/2009)


    ...what should i do as an administrator that when i insert a record to the table all the clients can see this inserted record real time in the network??

    In SQL Server 2005 you can use Notification Services, in SQL Server 2008 you can use Service Broker. For .NET client side have a look for SqlNotificationRequest

    It's not real-time but you don't need old school polling techniques.

    Greets

    Flo

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply