Friday, April 27, 2012

the TOP keyword in MSSQL

SELECT * FROM vwWhatever

 
 

May be refactored as follows to ensure the query does not time out in trying to pull back too many records.

SELECT TOP 1000 * FROM vwWhatever

 
 

Update on 10/22/2012: I think the 1000 above should be surrounded in parenthesis.

No comments:

Post a Comment