Riddhi Valecha

Riddhi Valecha

  • 427
  • 3.2k
  • 398k

SQL Query - Schedular in C#.net Plzz Help..

Jan 27 2014 2:08 AM
Hi all...

I need help in forming a SQL Query.

Requirements are as follows-
I have a table as below -
ID Repoonse Company Key 
 1 ErrorV1 
 2 Success B V1
 3 Error C V1
 4 Error D V2
 5Success  E V2
 6Error  V2
 7 Error G V3
 8 Success H V3

Now, my logic is -

I need all the records till I get success for each key.

Eg -

My result should be -

 IDResponse Company Key 
 1 ErrorV1 
 4Error DV2
 7ErrorG V3








Here, key V1 have success (in Response column). Hence, this key should not be picked anymore.

Key V2 have success (in ID-5). Hence, this key should not be picked any more.

No record should be picked once the Key have success.

I have to call this procedure on Timer Control on every 5 Minutes.

Hence, After 5 minutes, the records in the grid should not display the records of ID-1,4,7.

The main table will get updated every 2 minutes.

Once the Key hits a success, that record should not be picked.

This is a type of schedular.

Please help me out.

Thanks all in advance...