Click here to Skip to main content
15,899,313 members
Home / Discussions / Database
   

Database

 
QuestionMultiple insert in single roundtrip with Sqlcommand, Possible??? Pin
abcxyz8225-Mar-05 4:11
abcxyz8225-Mar-05 4:11 
AnswerRe: Multiple insert in single roundtrip with Sqlcommand, Possible??? Pin
ToddHileHoffer25-Mar-05 4:35
ToddHileHoffer25-Mar-05 4:35 
GeneralRe: Multiple insert in single roundtrip with Sqlcommand, Possible??? Pin
Colin Angus Mackay25-Mar-05 6:32
Colin Angus Mackay25-Mar-05 6:32 
AnswerRe: Multiple insert in single roundtrip with Sqlcommand, Possible??? Pin
_J_25-Mar-05 7:19
_J_25-Mar-05 7:19 
AnswerRe: Multiple insert in single roundtrip with Sqlcommand, Possible??? Pin
_J_25-Mar-05 11:19
_J_25-Mar-05 11:19 
QuestionHow to ROLLBACK TRANSACTION on client level Pin
_J_25-Mar-05 3:32
_J_25-Mar-05 3:32 
AnswerRe: How to ROLLBACK TRANSACTION on client level Pin
Luis Alonso Ramos25-Mar-05 12:21
Luis Alonso Ramos25-Mar-05 12:21 
AnswerRe: How to ROLLBACK TRANSACTION on client level Pin
turbochimp25-Mar-05 18:02
turbochimp25-Mar-05 18:02 
Short answer: try SET XACT_ABORT ON...

"If a run-time statement error (such as a constraint violation) occurs in a batch, the default behavior in SQL Server is to roll back only the statement that generated the error. You can change this behavior using the SET XACT_ABORT statement. After SET XACT_ABORT ON is executed, any run-time statement error causes an automatic rollback of the current transaction. Compile errors, such as syntax errors, are not affected by SET XACT_ABORT.<br />
<br />
It is the responsibility of the programmer to code the application to specify the correct action (COMMIT or ROLLBACK) if a run-time or compile error occurs."

-- SQL Server Books Online

A better answer would be to include error handling. There's a very good article
here[^] that describes one strategy for getting more predictable results from stored procedures through error handling.

The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

GeneralRe: How to ROLLBACK TRANSACTION on client level Pin
_J_25-Mar-05 23:56
_J_25-Mar-05 23:56 
Generalreturning table from a stored procedure Pin
balkang25-Mar-05 2:52
balkang25-Mar-05 2:52 
GeneralRe: returning table from a stored procedure Pin
_J_25-Mar-05 3:00
_J_25-Mar-05 3:00 
GeneralRe: returning table from a stored procedure Pin
balkang25-Mar-05 23:25
balkang25-Mar-05 23:25 
GeneralIs Insert, Delete, Update already have transaction Pin
_J_25-Mar-05 1:59
_J_25-Mar-05 1:59 
GeneralRe: Is Insert, Delete, Update already had transaction Pin
Colin Angus Mackay25-Mar-05 2:07
Colin Angus Mackay25-Mar-05 2:07 
GeneralRe: Is Insert, Delete, Update already had transaction Pin
_J_25-Mar-05 2:12
_J_25-Mar-05 2:12 
GeneralRe: Is Insert, Delete, Update already had transaction Pin
Colin Angus Mackay25-Mar-05 2:25
Colin Angus Mackay25-Mar-05 2:25 
GeneralRe: Is Insert, Delete, Update already had transaction Pin
_J_25-Mar-05 2:38
_J_25-Mar-05 2:38 
GeneralRe: Is Insert, Delete, Update already had transaction Pin
turbochimp25-Mar-05 20:30
turbochimp25-Mar-05 20:30 
GeneralT-SQL Question Pin
Mickey_WWW24-Mar-05 19:09
sussMickey_WWW24-Mar-05 19:09 
GeneralRe: T-SQL Question Pin
_J_25-Mar-05 1:56
_J_25-Mar-05 1:56 
GeneralRe: T-SQL Question Pin
Tony Lewis25-Mar-05 10:00
Tony Lewis25-Mar-05 10:00 
GeneralRe: T-SQL Question Pin
WDI26-Mar-05 0:05
WDI26-Mar-05 0:05 
GeneralRe: T-SQL Question Pin
Tony Lewis26-Mar-05 2:05
Tony Lewis26-Mar-05 2:05 
GeneralRe: T-SQL Question Pin
turbochimp25-Mar-05 18:12
turbochimp25-Mar-05 18:12 
GeneralRe: T-SQL Question Pin
Suman Singh29-Mar-05 11:38
professionalSuman Singh29-Mar-05 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.