Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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)

Generate Insert/Update/Delete Sprocs for a table

By well0549,

A week ago I posted this script. It was a much simpeler version without error checking. Now all the sprocs return the same errors.

    0 THERE WERE NO ERRORS
  -99 UNEXPECTED NR OF RECORDS AFFECTED
  0 THE SQL ERROR NUMBER

Also with the insert statement the @ID is set. So you can retrieve the Identity of the last row inserted.

The construct with the returnvalue could be simpeler but then we could not use it with the .net applicationblocks.

This script will generate Insert,Update,Delete,Get stored procedures for a given table.

It will only work if the Primary key is also an Identity field.

If you like it vote for it.......

Total article views: 368 | Views in the last 30 days: 3
 
Related Articles
FORUM

Bulk insert error

Bulk insert error

FORUM

Bulk Insert batch error

Bulk Insert batch error

FORUM

Bulk Insert error logging

Bulk Insert Task error logging

FORUM

Insert fail Data Type Error Fix??

Insert fail type error suggestions

ARTICLE

Error logging with Bulk Insert

Bulk Insert statement has an important feature of error logging which is rarely used.

 
Contribute