none
select * from tagevents never ends RRS feed

  • Question

  • hi..

     

    i am using the sqlsink adapter...trying to run the following...select * from tagevents...

     

    ...never ends

     

    so i go in sql server and try...the query never ends...i have to stop it manually...

     

    why is this???

    Monday, August 4, 2008 4:15 PM

Answers

  • Hi,

     

    How many rows do you have in that table?

     

    When using the SQL adapter for receiving messageas, you often what to update the table in the same transaction as the select. You can do this usting a stored procedure.

     

    You may also want to read just one tag per call:

     

    CREATE PROCEDURE NewCustOrders
    AS
       SELECT TOP 1 *
       FROM Orders
       WHERE ShippedDate IS NULL
       ORDER BY OrderID
       FOR XML AUTO
    
       UPDATE orders
       SET ShippedDate = GETDATE()
       WHERE ShippedDate IS NULL
    GO

    You can use the Poll while data found option to bring in all the records quickly.

     

    Theres some more info here:

     

    http://msdn.microsoft.com/en-us/library/ms962185.aspx

     

    Regards,

     

    Alan

     

     
    Tuesday, August 5, 2008 7:09 AM

All replies

  • Hi,

     

    How many rows do you have in that table?

     

    When using the SQL adapter for receiving messageas, you often what to update the table in the same transaction as the select. You can do this usting a stored procedure.

     

    You may also want to read just one tag per call:

     

    CREATE PROCEDURE NewCustOrders
    AS
       SELECT TOP 1 *
       FROM Orders
       WHERE ShippedDate IS NULL
       ORDER BY OrderID
       FOR XML AUTO
    
       UPDATE orders
       SET ShippedDate = GETDATE()
       WHERE ShippedDate IS NULL
    GO

    You can use the Poll while data found option to bring in all the records quickly.

     

    Theres some more info here:

     

    http://msdn.microsoft.com/en-us/library/ms962185.aspx

     

    Regards,

     

    Alan

     

     
    Tuesday, August 5, 2008 7:09 AM
  • You can also try

     

    select * from table1 with (nolock)

     

    Tuesday, August 5, 2008 8:21 AM
  • thanks for the help...

     

    Tuesday, August 5, 2008 1:54 PM