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
mohammed shamsheer
NA
394
143.6k
IS IT POSSIBLE TO EXEC SP INSIDE SP AND EXECCUTE IF BY THE R
Dec 22 2014 7:39 AM
CONTEXT :
I WANT TO UPDATE THE FIELD OF TABLE 'A' TO FALSE
AND I WANT TO EXCECUTE ANOTHER STORED PROCEDURE AND BASED ON ITS RETURNED VALUE
I WANT TO CHECK THE IF CONDITION AND EXECUTE ANOTHER STATEMENT
IS IT POSSIBLE IF IT POSSIBLE HOW
MY SAMPLE CODE :
UPDATE CheckInOut SET IsActive=0,ActionStatus='D'
where VocherType=@VocherType
AND InOutMasterID=@InOutMasterID
AND BranchID=@BranchID
BEGIN
DECLARE COUNT1 AS INT
SELECT COUNT1=EXEC Check_ConfHallStatus @RoomID,@VocherType,@BranchID
IF(COUNT1>0)
BEGIN
UPDATE Rooms SET RoomStatus='Occupied' WHERE RoomID=@RoomID
END
ELSE
BEGIN
UPDATE Rooms SET RoomStatus='Vacant' WHERE RoomID=@RoomID
END
END
----------------------------------------
Check_ConfHallStatus :
ALTER PROCEDURE Check_ConfHallStatus
(
@RoomID BIGINT
--,@ActionStatus VARCHAR(5)
,@VocherType VARCHAR(15)
,@BranchID bigint
)
as
SELECT COUNT(*) AS CNT FROM CheckInOut
WHERE IsActive=1
AND RoomID=@RoomID
AND ActionStatus='A'--@ActionStatus
AND VocherType=@VocherType
AND BranchID=@BranchID
------------------------------------------------
Reply
Answers (
2
)
Can we save empty string into bigint column
Convert row to a single column