TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Transaction SQL
Burak Seyhan
Feb 08
2015
Code
1.1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Create
Database
Demo
go
use Demo
go
Create
Table
Customer
(
Id
int
primary
key
identity(1,1),
FirstName nvarchar(25)
not
null
,
LastName nvarchar(25)
not
null
,
Age
int
)
go
insert
Customer(FirstName,LastName,Age)
values
(
'User1'
,
'User12'
,17)
insert
Customer(FirstName,LastName,Age)
values
(
'User123'
,
'User1234'
,22)
insert
Customer(FirstName,LastName,Age)
values
(
'User12345'
,
'User123456'
,25)
Select
*
from
Customer
-- Starting delete operation or operations
Begin
Transaction
Delete
From
Customer
Where
Id=3
-- Come Back to deleted data. It's really important for all of us.I Believe that Rollback is a security key
RollBack
Tran
Select
*
from
Customer
-- Accept for Deleted Data
Commit
Tran
Select
*
from
Customer
Transaction
Sql