Find first record where kev value is >= search value (AS400 'SETLL')

  • Thread starter Thread starter Bishman
  • Start date Start date
B

Bishman

Hi,

I wish to read a record / records whose key value is equal to or greater
than the search value,

ie: If a table has ten records whose key values where 10,20,30 ..... -> 100
and I had 35 as the search value I want to position ( a cursor ? ) to
before the record whose kev val is 40 and read all subsequent records, 40,
50,60,70... etc. Of course 40 may not be the next record, it could 523 or
any such value, assuming the table is ordered ascending.

I come from an iSeries / AS400 background where such a procedure would be a
SETLL (Set lower limits).

I appreciate SQL server works differently but how would I achieve the same
result ?

Using C# / VS2005 and SQL Server 2005.

Thanks.
 
Bishman,

Use a Select statement with a Where clause with the appropriate condition.

Also, use an Order By clause to return the data in the appropriate order.

Kerry Moorman
 
That simple ? OK Thanks.

JB

Kerry Moorman said:
Bishman,

Use a Select statement with a Where clause with the appropriate condition.

Also, use an Order By clause to return the data in the appropriate order.

Kerry Moorman
 
Back
Top