Bob,
I tried it and it worked as expected (several rows exist). The only thing that I can think of that might be causing your problem is that perhaps you are inadvertanly connecting to a different database in code than the one you tested with in Sql Server Management Studio (it happened to me <g>).
~~Bonnie
>Well, not exactly. Username = "FRED" so both conditions have not been met, and when tracing the code, it goes back to the top of the While loop and then exits...so only one row is being returned.
>
>Any ideas?
>
>bob
>
>
>>>But when I try to run the following code I only get one row (the first above). Any ideas?
>>
>>Becuase you
return from within the while loop if Role matches (and the first row matches).
>>
>>Einar