What is a Stored Procedure?
So, basically stored procedure or SP is a permanent database object, used to meet business requirement like loading and creation of table, validating source dataset, profiling and gathering data statistics, performing auditing, cataloging any server level information etc.
To Understand more about stored procedure, lets say, for a business requirement source dataset need to be profiled and statistics need to be found in order to get information about the source data:-
CREATE PROC PROC_NAME
(
)
AS
BEGIN
BEGIN TRY
SELECT
COUNT(*) AS TOTAL_ROWS,
MAX(COL1) AS MAXIMUM VALUE
INTO #TEMP1
FROM
END TRY
BEGIN CATCH
END CATCH
END
Comments
Post a Comment