Here’s example to get 2nd row data with sql query
1 2 3 4 5 6 7 | ;WITH YourCTE AS ( SELECT TOP 2 *, ROW_NUMBER() OVER(ORDER BY [YourColumn]) AS RowNumber FROM [YourTable] ) SELECT * FROM YourCTE WHERE RowNumber=2 |
Here’s example to get 2nd row data with sql query
1 2 3 4 5 6 7 | ;WITH YourCTE AS ( SELECT TOP 2 *, ROW_NUMBER() OVER(ORDER BY [YourColumn]) AS RowNumber FROM [YourTable] ) SELECT * FROM YourCTE WHERE RowNumber=2 |
This is SQL Query for resetting Table Indentity :
1 | DBCC CHECKIDENT ([Table_Name], reseed, Reset_Number_To) |
place your Table Name in [Table_Name] and replace Reset_Number_To with number you want to start the identity for the next record, for example if you want your identity number start from 1, you replace Reset_Number_To with 0