Tuesday, November 29, 2011

1 TABLESAMPLE

 

We can use the tablesample to limit the return result sets. The difference using tablesample and top is top would always retrieve top N rows but tablesample would get the sampling of the data.

TABLESAMPLE would go to each 8K page and get the sample data. That being said if the table has 20 pages but only one page has all table’s data. It is possible it wont get the data back.

  1. USE AdventureWorks;
  2. SELECT *
  3. FROM person.address
  4. TABLESAMPLE (10 PERCENT)

 

  1. USE AdventureWorks;
  2. SELECT *
  3. FROM person.address
  4. TABLESAMPLE (50 ROWS)

Reference

Limiting Result Sets by Using TABLESAMPLE http://msdn.microsoft.com/en-us/library/ms189108.aspx

1 comments:

  1. Breitling watches replica watches have been at the pinnacle replica breitling premier watches of the watch industry since entering the marketplace in 1884. Today, the Breitling name is a true giant among timepiece manufacturers, renowned for inventing the chronograph and for exceptional quality control standards. When you buy a Breitling watch, you choose a product made with excellence in precision. Breitling is a standard in the aviation and driving industries, as well as a favorite of the adventurer. Some of the most iconic collections include the: Navitimer, Bentley, Superocean, Avenger, Galactic, Chronomat, and Transocean. we offer a variety of authentic Breitling watches for sale in men's and women's styles. Shop our site to find the best in discount Breitling watches online.

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates