Matheus Cardoso
Matheus Cardoso
PPrisma
Created by Matheus Cardoso on 3/25/2025 in #help-and-questions
How does Prisma ORM build select Top in SQL Server?
My problem, can reply this query SELECT TOP 1000 * FROM [User] ORDER BY [id] ASC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY; I have a question about how Prisma builds queries with TOP. In the code below, which of the SQL statements will Prisma execute in the SQL Server database? const users = await prisma.user.findMany({ take: 10, }); Option 1 SELECT TOP 10 * FROM [User]; Option 2 SELECT * FROM [User] ORDER BY [id] ASC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY;
3 replies