Showing posts with label SQL Servers. Show all posts
Showing posts with label SQL Servers. Show all posts

Wednesday, 30 December 2015

Custom Paging for Gridview using SQL Server

 

Custom Paging for Gridview using SQL Server:





Description:




In my previous article I'm explaining Load on demand
, but in this article I'm going to explain how to load data for particular page dynamically using SQL server, for example in some scenarios we want to load huge data, usually what we are doing load all the records and display gridview and perform paging using default grid page options, but when we are looking performance and bandwidth the approach is not good, so that only we are moving forward that load fixed page records based on page size and currentpage index. 


Saturday, 31 August 2013

Display DataNames between Two Date's in SQL server...


Date Names between Two Dates:


1) Find the no.of days between two dates using DateDiff function.
      SELECT DATEDIFF(DAY,@start_date,@end_date)

2) Declare the starting count as "0", and end count is no.of days between two dates
      DECLARE @end_count INT=(SELECT DATEDIFF(DAY,@start_date,@end_date))
      
DECLARE @start_count INT=0

3) Using While loop you can iterate the function.

      
WHILE (@start_count < @end_count)
      
BEGIN  
        
--statements
      
END
 

How to set Identity increment ON / OFF in SQL


How to Set IDETITY ON/OFF



In this article I'm trying to explain how to fix identity value how to change the identity value and how to update that value with proper order using Identity column on / off.
 

What is Stored Procedure..? Usage of Stored Procedures..?



Stored Procedure's :

 
                 Whenever we want to interact with a Database from an application we use SQL statements. These SQL statements when used with in an application has a problem i.e. when we run the application Statements will be sent to DB for execution where the statements to be parsed / Compile and then execute. The process of parsing takes place each time , because of which performance of application is decreases. To overcome the above drawback write SQL statements directly in Database itself, with in an object known as Stored Procedures .As a SP is pre-compiled block which is ready for execution will directly execute the statements without parsing each time.