What is the difference between
Set Rowcount X
And
Select Top X *
From Z
in TSQL?
The main difference is that top
will only effect the query you are running while set rowcount
will persist with the connection and apply to all queries executed within that connection.
Top can do a few more things for you. For one, you can specify a percentage, instead of an integer. You can also handle situations where ties in column values occur.
http://technet.microsoft.com/en-us/library/ms189463.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With