-- ============================================= -- Author: Muhammad Jawad -- Create date: 2/2/2017 -- Description: To Get All the Names of tables and Databases whose data have changed in last 24 Hours -- ============================================= ALTER PROC UP_FindAllDatabaseHaveChanges AS BEGIN DECLARE @loopStart INT= 1; DECLARE @looend INT; IF OBJECT_ID('tempdb..#AllDatabaseTables') IS NOT NULL BEGIN DROP TABLE #AllDatabaseTables; END; CREATE TABLE #AllDatabaseTables ( ID INT IDENTITY(1, 1) PRIMARY KEY , ...
-- ============================================= -- Author: Muhammad Jawad -- Create date: 2/3/2017 -- Description: To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases -- ============================================= Alter PROC UP_FindAndBackupAllDatabaseHaveChanges AS BEGIN ----**************************START: To get all the tables and database names whose data have changed in last 24 hours **************************---- DECLARE @loopStart INT= 1; DECLARE @looend INT; IF OBJECT_ID('tempdb..#AllDatabaseTables') IS NOT NULL BEGIN DROP TABLE #AllDatabaseTables; END; CREATE TABLE #AllDatabaseTables ( ...
@intPageId int, @intPageSize int select * from ( Select row_number() over (order by TableA.intID asc ) r , TableA.intID,tableA.hName,TableB.Address from TableA Join TableB on TableA.intid = TableB.intId ) A where A.r between ( (@intpageid-1)*@intpagesize)+1 and ((@intpageid-1)*@intpagesize)+@intpagesize The query in bold text is for paging, and the normal text query is that which returns your records. OR SELECT * from PressRelease order by CreatedDate desc OFFSET (@PageID-1)*@PageSize ROWS FETCH NEXT @PageSize ROWS ONLY
Comments
Post a Comment