VB and VBA Users Source Code: Generic Stored Procedure Heading Template
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Generic Stored Procedure Heading Template
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Monday, August 04, 2003
Hits:
1008
Category:
Database/SQL/ADO
Article:
Below is an example of a stored procedure creation routine (including a heading). use mydatabase go IF OBJECT_ID('dbo.procMyStoredProc') IS NOT NULL BEGIN DROP PROCEDURE dbo.procMyStoredProc IF OBJECT_ID('dbo.procMyStoredProc') IS NOT NULL PRINT '<<< FAILED DROPPING PROCEDURE dbo.procMyStoredProc >>>' ELSE PRINT '<<< DROPPED PROCEDURE dbo.procMyStoredProc >>>' END go create procedure procMyStoredProc ( @var1 varchar(50), @var2 varchar(50) ) as /* ******************************************* * Description: My Description * * Author: Andrew Baker * Date: 5 Aug 2003 * * * * Changes: * [Date] [Name] [Description] * 5 Aug 2003 Andrew Baker Added to database ****************************************** */ /* STORED PROC SQL GOES HERE */ --Return success return 0 go IF OBJECT_ID('dbo.procMyStoredProc') IS NOT NULL PRINT '<<< CREATED PROCEDURE dbo.procMyStoredProc >>>' ELSE PRINT '<<< FAILED CREATING PROCEDURE dbo.procMyStoredProc >>>' go --Permissioning here GRANT EXECUTE ON dbo.procMyStoredProc TO public go
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder