---
title: "How to selecte random records from SQL Server table?"  
description: "How to selecte random records from SQL Server table?"  
author: "Anonymous User"  
published: 2012-03-24  
updated: 2012-03-26  
canonical: https://www.mindstick.com/forum/396/how-to-selecte-random-records-from-sql-server-table  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# How to selecte random records from SQL Server table?

Hello Everyone, \
I want to [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) [records](https://www.mindstick.com/forum/34640/how-to-create-a-stored-procedure-for-display-all-records) randomly from my [SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) [Server table](https://www.mindstick.com/forum/159948/how-to-check-if-a-column-exists-in-a-sql-server-table). Could you [explain](https://www.mindstick.com/forum/157854/what-is-system-debugging-explain-some-system-debugging-tools-used-in-modern-computer-systems) it with the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) that how to do it? \
\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!!

## Replies

### Reply by Anonymous User

Hi Tanuj Kumar,\
In [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) database, there is a function NEWID() through which we can select SQL table record randomly. \
Query:

```
 select * from tbl_Name order by newid()
```

I hope it might be resolve your problem.\

``


---

Original Source: https://www.mindstick.com/forum/396/how-to-selecte-random-records-from-sql-server-table

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
