HOME

Tuesday, February 14, 2012

what rowcount clause in Sql Server

“SET ROWCOUNT” limits the number of rows returned. Its looks very similar to “TOP” clause, but there is a major difference the way SQL is executed. The major difference between “SET ROWCOUNT” and “TOP” SQL clause is :-
“SET ROWCOUNT is applied before the order by clause is applied. So if "ORDER BY"clause is specified it will be terminated after the specified number of rows are selected. ORDER BY clause is not executed”



SET ROWCOUNT 10
GO
UPDATE venkattable
SET id = 5000
WHERE id >= 5000
GO

No comments:

Post a Comment