Select top N records in T-SQL / SQL Server

visibility 73 access_time 4 years ago languageEnglish timeline Stats
timeline Stats
Page index 0.10

In different databases, the syntax of selecting top N records are slightly different. They may also differ from ISO standards.

In SQL Server, use TOP (N) to retrieve the first N records in the table. Remember to replace N with one actual number.

Code snippet

SELECT TOP (N) * FROM TableName;
info Last modified by Raymond 4 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
Convert string to date in T-SQL / SQL Server
visibility 373
thumb_up 0
access_time 3 years ago
Select from dual in T-SQL / SQL Server
visibility 338
thumb_up 0
access_time 4 years ago