Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Automatically generate SUID procs for any table

By Cade Bryant, 2008/01/02

As a database developer, coding the SELECT, UPDATE, INSERT, and DELETE (SUID) stored procedures for each table in your database can be tedious, boring, and time-consuming. For that reason, I created the procedure usp_GenerateProcsForTable, which automatically generates the basic SUID procedures for any given tablename passed in. Your table must have a primary key in order for this to work properly.

This tool is a huge timesaver for developers and DBAs.

The syntax is [EXEC] usp_GenerateProcsForTable [@table_name=] 'MyTable'.

If you want to go a step further and generate SUID procs for your entire database in one stroke........you can execute this proc via the system-supplied proc sp_MSForEachTable; i.e.,

sp_MSForEachTable 'usp_GenerateProcsForTable ''?'''

 

 

 

Total article views: 1192 | Views in the last 30 days: 8
 
Related Articles
FORUM

stored procedures in a database

stored procedures in a database

FORUM

Procedure to see database status

Procedure to see database status

FORUM

Stored Procedure & 'other' database

How to have a Stored Procedure work on another database

FORUM

DATABASE NAME AS PARAMETER IN PROCEDURE

DATABASE NAME AS PARAMETER IN PROCEDURE

SCRIPT

Search All Stored Procedures in a Database

Search for a text in all the stored Procedures in a Database

Tags
automation    
development    
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones