MSSQL Query with more than 2100 parameter leads to a sql exception
- Dominant language
- TypeScript
- Stars
- 37.9k
- Forks
- 4.9k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 36
Description
### Describe the Bug
I have a collection with an 1:n relation to another collection. Something like Authors to Books.
If i have an author with more than 2100 books, its not possible to open the list of all authors.
The query ends with:
```
{
"errors": [
{
"message": {
"code": "EREQUEST",
"number": 8003,
"state": 1,
"class": 16,
"serverName": "a8ab61c49291",
"procName": "",
"lineNumber": 1
},
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}
```
The executed sql was:
``` sql
select top (@p0) [collection].[id], [collection].[a] .. from [[collection] where [collection].[foreignKey] in (@p1, @p2,........)
order by [collection].[id] asc
```
The SQL Result is:
```
The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
```
If i open the collection details of the author collection, everything works fine. The issue occurs only in the collection list overview.
### To Reproduce
Create a relationship with more than 2100 childs.
### Directus Version
10.10.4
### Hosting Strategy
Self-Hosted (Docker Image)
Contributor guide
Assessment
This issue has not been assessed yet.