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 
Salman BegPosted Oct 14, 2016, 3:30 AM
Posted Oct 14, 2016, 2:29 AM
Bikesh SrivastavaPosted Sep 30, 2016, 8:17 AM
siva balanPosted Sep 30, 2016, 1:07 AM
Tapan Patel
Its working fine in local sqlserver, If i hosting in cloud its through thats type of error...Tapan PatelPosted Sep 29, 2016, 10:27 AM