I had an situation where i want to get the last row for Non_Identity Table.
Then i used this query to get the last row inserted into the table.
Below screenshoot will explain
Then i used this query to get the last row inserted into the table.
DECLARE GETLAST CURSOR DYNAMIC FOR
SELECT
[ColumnName] FROM [dbo].[TableName]
OPEN GETLAST
FETCH LAST FROM GETLAST
CLOSE GETLAST
DEALLOCATE GETLAST
No comments:
Post a Comment