Avatar

Simon's SQL

DevOps, Kubernetes, AI/ML and database platform notes from Simon Cho โ€” AVP of DevOps & DBA at Nowcom, PASS Summit speaker.

  1. Home
  2. About
  3. Talks
  4. Archives
  5. Search
    1. Dark Mode
T-SQL & Scripts

Selecting Rows Randomly from a Large Table

Jun 12, 2014 1 minute read

http://msdn.microsoft.com/en-us/library/cc441928.aspx

1
2
3
4
SELECT * FROM Table1
WHERE (ABS(CAST(
(BINARY_CHECKSUM(*) *
RAND()) as int)) % 100) < 10 -- Percent

SELECT * FROM Table1 TABLESAMPLE (1 percent) ORDER BY NEWID()

Big Table Large Table Randomly
Share LinkedIn X Facebook
Last updated on Jun 30, 2014

Related content

sys.sysobjvalues

Global ErrorLog SP example

SSIS Catalog Execution with T-SQL

DBCC help(โ€˜?โ€™) want to see all hidden DBCC command

Alert email sending

© 2011 - 2026 Simon Cho
Simon Cho ยท simon@simonsql.com
Built with Hugo
Theme Stack designed by Jimmy