Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Retrieving value from EXEC(@sql)
- SELECT top (value) field, field2 FROM table
- SELECT @first = min(field2) FROM (SELECT top (value) field, field2 FROM table)
- DECLARE @RowCount int -- =25 -- sql server 2008 allows to assign when declaring
- SELECT @RowCount = 25
- SELECT TOP (@RowCount) * FROM table1
- DECLARE @RowCount int
- SELECT @RowCount = 25
- SET ROWCOUNT @RowCount
- SELECT * FROM table1
- SET ROWCOUNT 0 -- make sure to set back to 0 otherwise
- -- queries below will return 25 rows
- declare @top int = 10
- select top (@top) field, field2 from table
Advertisement
Add Comment
Please, Sign In to add comment