select top 5 * from emp order by newid()

my question is , how this query get executed?

Answer Posted / sanjeev kumar

newid() used with uniqueidentifier data types in a table
and uniqueidentifier datatype is used to insert randomly
new number, so the above query will give top 5 records in
randomly manner.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are user defined functions in ms sql server?

510


How to enter unicode character string literals in ms sql server?

575


How to defragment table indexes?

548


How many types of the database links?

604


How can i Relate Tables in SSIS

576






Can we write ddl in trigger?

495


How to define output parameters in stored procedures?

523


What should be the fill factor for indexes created on tables? : sql server database administration

622


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

2060


What happens when transaction log is full?

513


Explain unique key in sql server?

536


How would you choose between a clustered and a non-clustered index?

543


How adventureworkslt tables are related?

531


Explain what are the basic functions for master, msdb, model, tempdb databases?

528


Why do we use non clustered index?

551