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

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

CRUD generator

By Ryan Foote,

Introduction

Often times DBA's are tasked with creating simple create, read, update, and delete stored procedures and scripts. I created a script to quickly generate the T-SQL for CRUD statements in an easy to read formatted output. This will give a DBA a good starting point to easily generate a template for CRUD statements.

 

How to use

Enter the name of the defined table as the @TableName parameter to generate the CRUD statements against. Choose the type of CRUD statement for the @TypeOfCrud parameter and there is a key listed as a comment in the script. If using parameters for the insert statement then set @Parameters equal to 1 if not using parameters for the insert statement then set @Parameters equal to 0.

 

 

Total article views: 3023 | Views in the last 30 days: 13
 
Related Articles
FORUM

Dynamic Stored Proc to generate Create Table Script ,taking table_name as parameter

Dynamic Stored Proc to generate Create Table Script ,taking table_name as parameter

ARTICLE

Generating Insert Statements

This article from new author Oleg Netchaev describes the cursor-less script used to generate insert ...

SCRIPT

Generate Drop / Create Script for views, stored Procedures

This Script generates drop and create scripts for views or stored procedures.

SCRIPT

Generate Insert Statements

This script Generates the insert statements for a particular table.

SCRIPT

Scripting CREATE INDEX Statements Automatically From Your Tables

Stored proc for scripting out full CREATE INDEX statements from your table indexes with all filegrou...

Tags
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