SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Insert Update Stored Procedure for a table

By Prasad Bhogadi, 2007/12/06

Total article views: 7437 | Views in the last 30 days: 1102

This is a small script that generates Insert and Update Stored Procedure for a selected table. The script asssumes that it has a primary key with auto identity defined. The user needs to have admin access on the database as it uses system tables. I have scripted this for my primary use of creating base templates where the tables have many columns. The users may want to customize as per their requirements. This uses same logic as that is used by the system stored procedure to fetch the table definition.

 

Run the script from your ISQL and execute the stored procedure for a table for which you want to generate Insert /update script stored procedure with input parameters.

Do let me know if you have any questions.

By Prasad Bhogadi, 2007/12/06

Total article views: 7437 | Views in the last 30 days: 1102
Your response
 
 
Related tags
 
Like this? Try these...

Generate SQL Scripts from Database

By Absinthe | Category: DMO
(not yet rated) | 1,156 reads

Print The Calender

By vinaykumar | Category: T-SQL
| 910 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com