SELECT TOP (@count) * FROM SomeTable
This will only work with SQL 2005+
More Related Contents:
- Insert results of a stored procedure into a temporary table
- Select top 10 records for each category
- How important is the order of columns in indexes?
- Using the result of an expression (e.g. Function call) in a stored procedure parameter list?
- sql query to return differences between two tables
- SQL Server – transactions roll back on error?
- Difference between a User and a Login in SQL Server
- Convert Xml to Table SQL Server
- Fastest way to update 120 Million records
- For Nvarchar(Max) I am only getting 4000 characters in TSQL?
- Is it possible to select sql server data using column ordinal position
- How to find current transaction level?
- How do I group on continuous ranges
- How can a LEFT OUTER JOIN return more records than exist in the left table?
- “select * from table” vs “select colA, colB, etc. from table” interesting behaviour in SQL Server 2005
- Dynamic SQL to generate column names?
- Is it possible to perform multiple updates with a single UPDATE SQL statement?
- Extracting hours from a DateTime (SQL Server 2005)
- Column name or number of supplied values does not match table definition
- Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon
- SQL Server PIVOT perhaps?
- How to find consecutive rows based on the value of a column?
- Custom aggregate function (concat) in SQL Server
- How to escape square brackets inside square brackets for field name
- How do you copy a record in a SQL table but swap out the unique id of the new row?
- How to change column order in a table using sql query in sql server 2005?
- Is there a quick way to check if ANY column is NULL?
- Why do SQL Server Scalar-valued functions get slower?
- SQL query for parent-child chain
- Querying Active Directory from SQL Server 2005