How to Retrieve a Random Record from a Table in SqlServer

SQL Query to display a random record from table in sqlserver.

Syntax:Select Top 1 * From tablename Order By NewId()

Example:Select Top 1 * From emp Order By NewId()

Above query will display one random record.

SQL Query to copy structure and data of one table to other in Sql Server.

Software Testing-QTP,Testing Tools,Testing Faqs

Collection of SQL Queries

No comments:

Recent Posts