Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting 14 random records
Message
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01382524
Message ID:
01382653
Views:
31
>>>BTW, how can we search for a specific thread ID ?
>>
>>Just enter the thread ID in the Message ID. A thread ID is the first message ID of the thread.
>
>Thanks. BTW, I'm not sure how to read the results
>
>
>set statistics TIME ON
>/****** Script for SelectTopNRows command from SSMS  ******/
>Select * from [AdventureWorks].[Production].[TransactionHistory] WHERE TransactionID = 
>(Select Top 1 [TransactionID] from [AdventureWorks].[Production].[TransactionHistory]
>Order By NewID() )
>
>SELECT TOP 1 [TransactionID]
>      ,[ProductID]
>      ,[ReferenceOrderID]
>      ,[ReferenceOrderLineID]
>      ,[TransactionDate]
>      ,[TransactionType]
>      ,[Quantity]
>      ,[ActualCost]
>      ,[ModifiedDate]
>  FROM [AdventureWorks].[Production].[TransactionHistory] order by NEWID()
Anyone can run the above query and check the execution plan? Or better on really large table?

Thanks again.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform