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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
siva balan
NA
92
8.9k
Store procedure issue
Sep 29 2016 9:24 AM
I have error in my store procedure execution time.....
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1
My store procedure is
ALTER procedure [State](
@stid varchar(15),
@stname varchar(50),
@crdate date,
@Action varchar(15)
)
as
begin
SET NOCOUNT ON
SET XACT_ABORT ON
begin try
begin transaction
if(@Action='INS')
begin
insert into tblState(StId,State,CreatedDate) values (@stid,@stname,@crdate)
end
else if(@Action='ALL')
begin
select * from tblState
end
else if(@Action='UPD')
begin
update tblState set State=@stname where StId=@stid
end
else if(@Action='DEL')
begin
Delete from tblState where StId=@stid
end
else if(@Action='sel')
begin
select * from tblState where StId=@stid
end
else if(@Action='val')
begin
select State from tblState where State=@stname
end
commit
end try
begin catch
IF @@TRANCOUNT > 0
ROLLBACK
end catch
end
Please help me guys..... I am struggle in this error
Reply
Answers (
5
)
How to display orderno with its quantity
How to count total no of month between two dates