Difference between TOP clause in SQL Server 2000 and SQL Server 2005.
Difference between TOP clause in SQL Server 2000 and SQL Server 2005. Generally TOP clause is used to perform SELECT on top n results. This feature of TOP is extended in SQL Server 2005 so that we can also use expression apart from int, bigint and percent to perform query, also extended to be used in UPDATE and DELETE statements. In SQL Server 2000 syntax: select Top N [Percent] EX: select Top 10 * from TableName or select Top 10 Percent * from TableName n specifies how many rows are returned. If PERCENT is not specified, n is the number of rows to return. If PERCENT is specified, n is the percentage of the result set rows to return Drawbacks: We could not parametrize. It will work only for select statements. If we want to restrict the number of rows affected by a select at runtime, or restrict the rows affected by an update or delete you had to explicitly describe the rows using a join or where clause, or you could cheat a bit by using ROWCOUNT, like this set rowcount 10 delete from t...