# LookupRowsCS()

Returns an unordered rowset from a data extension. The function can return a rowset with up to 2,000 rows. This function is case-sensitive.

AMPscript includes several variations of the `LookupRowsCS()` function.

- The [LookupRows()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-rows.md) function is a case-insensitive version of this function.
- The [LookupOrderedRows()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-ordered-rows.md) function allows you to specify a column and direction to sort the rowset by.
- The [LookupOrderedRowsCS()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-ordered-rows-cs.md) function is a case-sensitive version of `LookupOrderedRows()`.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
LookupRowsCS(dataExt,
             searchColumn1, searchValue1,
             [searchColumn2, searchValue2...])
```

The `LookupRowsCS()` function has three parameters.

- `dataExt` (string): Required. The name of the data extension that contains the data that you want to retrieve.
- `searchColumn1` (string): Required. The name of the column to search. This value is case-sensitive.
- `searchValue1` (string): Required. The value in the specified column that identifies the rows to retrieve. This value is case-sensitive.

You can optionally append additional search columns and values to the end of the parameter string.

## Usage

This example uses a data extension called "MembershipRewardsProgramme," which contains the data in this table.

| MemberId | FirstName | Surname    | RewardsPoints | RewardsTier | Area        |
| -------- | --------- | ---------- | ------------- | ----------- | ----------- |
| 1        | Dennis    | Smithers   | 92374         | 2           | Chelsea     |
| 2        | Pooja     | Chatterjee | 201042        | 1           | Hammersmith |
| 3        | Tomás     | Santos     | 69311         | 3           | Kensington  |
| 4        | Sun-Hi    | Kim        | 23999         | 4           | Twickenham  |
| 5        | Jian      | Yeh        | 15123         | 4           | Chelsea     |

This code retrieves a list of members where the value of the Area column is `Chelsea`.

```
<p>Members in Chelsea:</p>
<ul>
%%[
  Var @membersChelsea, @rowCount
  Set @membersChelsea = LookupRowsCS("MembershipRewardsProgramme","Area","Chelsea")
  Set @rowCount = RowCount(@membersChelsea)

  If @rowCount > 0 then
    For @counter = 1 to @rowCount do
      Var @row, @memberId, @firstName, @surname, @rewardsPoints
      Set @row = Row(@membersChelsea, @counter)
      Set @memberId = Field(@row, "MemberId")
      Set @firstName = Field(@row, "FirstName")
      Set @surname = Field(@row, "Surname")
      Set @rewardsPoints = Field(@row, "RewardsPoints")
]%%
  <li>%%=v(@firstName)=%% %%=v(@surname)=%% (member ID %%=v(@memberId)=%%) - Point balance: %%=v(@rewardsPoints)=%%</li>
%%[
      Next @counter
  EndIf
]%%
</ul>
```

The code example outputs an unordered list of results.

```
Members in Chelsea:

  • Dennis Smithers (member ID 1) - Point balance: 92374
  • Jian Yeh (member ID 5) - Point balance: 15123
```

## See Also

- [LookupRows()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup-rows.md)
