This blog is useful to all my friends who are working on the .Net Technology and wants to enhance their skills as well their problem solving ability.

Wednesday, February 5, 2014

Paging same like EF take and skip in Sql 2012 ... awesome work :)

select * from TableName order by ID desc
offset 0 rows fetch next 20 rows only

Here 0 means starting from and 20 means how many records you want to fetch ....

Another great things in 2012 is ... you can use "Through" steatement direct inside the catch block ...

BEGIN TRY
DECLARE @VarToTest INT
SET @VarToTest = 'C'
END TRY
BEGIN CATCH
THROW
END CATCH


Quite superb ....

No comments: