SQL Server 2008 – Get the List of Stored Procedures update/modify in last N number days

With the help of the given procedure one can get the list of Stored Procedures update or modify in last N number days. Script: — Get the List of Stored Procedures update/modify in last N number days CREATE PROCEDURE GetListModifySP ( @days INT ) AS SELECT name AS SP_Name, modify_date as Modfiy_Date FROM sys.objects WHERE TYPE = 'P' AND DATEDIFF(DD,modify_date, GETDATE()) < @days –Excecute the GetListModifySP –You can give the N of days as per requirement EXEC GetListModifySP 10 Hope

» Read more

SQL Server – Stored Procedure with Output Parameters

In SQL Server, there are two ways with we can pass parameters to procedures. INPut parameter OUTPut parameter INPut parameter These types of parameters are used to send values to stored procedures. OUTPut parameter These types of parameters are used to get values from stored procedures. This is similar to a return type in functions. In this post we will try to understand how stored procedure returns the parameter Example — Create a table CREATE TABLE myTable ( ID INT

» Read more

SQL Server – User Defined Functions vs. Stored Procedures

SQL Server user-defined functions and stored procedures have almost similar functionality. Both allow you to create a batch of SQL statements to execute on SQL server. Benefits: We can reuse the code from one program to another, this way we can increase the productivity. Centralize control, to make business logic changes in a single place that automatically affect all dependent applications. Difference between User Defined Functions and Stored Procedures   Stored procedures are called independently, using the EXEC command. Example: EXEC dbo.procedure_name ‘Parameter1’Functions are

» Read more