7
votes
Best practices for committing a transaction in SQL Server where TRY CATCH is used
The best way I have found to do this is the following code:
SET XACT_ABORT ON;
BEGIN TRY
BEGIN TRANSACTION
/*
Code goes here
*/
COMMIT TRANSACTION
END TRY
BEGIN CATCH
...
4
votes
Best practices for committing a transaction in SQL Server where TRY CATCH is used
Option A is the correct choice. It is possible for all statements in a transaction to work and then the actual COMMIT to fail, so you keep the COMMIT inside your TRY block so that any failure of the ...
3
votes
Accepted
What is back-end programming?
Back-end and front-end are emerging separations of concerns in development, typically these days "web development". In some shops you have two types of developers, often on separate teams. ...
3
votes
I am trying to run this code and I get an error at line 11
CREATE TABLE IF NOT EXISTS `tblproduct` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`image` text NOT NULL,
`price` double(10,2) NOT ...
2
votes
MySQL code error
You need to remove the comma after the last column declaration.
CREATE TABLE student
(
student_id INT PRIMARY KEY,
first_name VARCHAR(20),
major VARCHAR(20)
);
2
votes
Accepted
MYSQL - Operand should contain 1 column(s) - Nested Case statement
CASE in MySQL can either be a statement, or an expression.
Since your CASE statement is in a SELECT list, it's being treated as an expression. As an expression, it should return a single value. You'...
1
vote
Access Send Email. Loop Not Building Table
The problem was with the comments field. I had the field set to Rich Text and I was exporting Plain text on the query. [Comment(s):PlainText([Comments]
For some reason, if it got to a record with rich ...
1
vote
What is back-end programming?
Server side would typically have no UI.
Server side is the business rules, data layer, and database (if required). Server side will typically have authentication.
Client side is the UI and will ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
code × 12mysql × 5
sql-server × 3
query-performance × 2
oracle × 1
performance × 1
t-sql × 1
sql-server-2016 × 1
join × 1
restore × 1
select × 1
foreign-key × 1
transaction × 1
ms-access × 1
php × 1
primary-key × 1
plsql × 1
recovery × 1
scripting × 1
case × 1
information-schema × 1
exception × 1
format × 1