Fastest Data Loading using Bulk Load and Minimal Logging

Understanding Bulk Load Operations

There are two types of INSERTs in SQL server, first is singleton INSERT which inserts rows one by one and second type is BULK INSERT which feeds a continuous stream of data into a table, so this type of INSERT is much faster than singleton inserts. Read more Fastest Data Loading using Bulk Load and Minimal Logging

CS #1 Using SQL Hint OPTION RECOMPILE for improving performance

Problem Statement 

Stored procedure CS1_RECOMPILE is running slow for some input parameters combinations and running fine for other input parameters.

CREATE PROC CS1_RECOMPILE 
     @start_prod_id INT,
        @end_prod_id   INT
AS
  BEGIN
    SELECT TOP 10 ProductId
    FROM bigProduct
    ORDER BY ListPrice DESC;    

    SELECT TOP 10 *
    FROM bigTransactionHistory
    WHERE ProductID BETWEEN @start_prod_id AND @end_prod_id
    ORDER BY ActualCost DESC;
 END;
GO

Read more CS #1 Using SQL Hint OPTION RECOMPILE for improving performance