Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/t-sql/functions/newid-transact-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ SET @myid = 'A972C577-DFB0-064E-1189-0154C99310DAAC12';
SELECT @myid;
GO
```

### D. Query random data with the NEWID() function

The following example queries a random record from the `Production.Product` table using the `NEWID()` function. To query more records radomly, increase the `TOP` value.

```sql
SELECT TOP 1 ProductID, Name, ProductNumber
FROM Production.Product
ORDER BY NEWID()
GO
```


## See Also
[NEWSEQUENTIALID (Transact-SQL)](../../t-sql/functions/newsequentialid-transact-sql.md)
Expand Down