Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

how can I calling a stored procedure from another stored procedure

$
0
0

I have two store procedure that in one of them I want to get one field form my view that has a Date value.

In another StoreProcedure I want to convert the output value of first SP to Hijri Shamsi Date:

this is my first SP that get the date field:

Alter PROCEDURE GetExamDate @Id int
AS
select ExamTime from View_SubjectStudyCourse
where @Id=CourseId
Go

and then I want to use the below code in the second procedure to converts the Gregorian date to Hijri date is:

DECLARE @DateTime AS DATETIME
SET @DateTime=GETDATE()
SELECT @DateTime AS [Gregorian Date]
, CONVERT(VARCHAR(11),@DateTime,131) AS [Gregorian date to Hijri date]
GO
and now I don't know how to use the above code in second SP and how can I return value of the <g class="gr_ gr_24 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="24" id="24">GetExamDate</g> Procedure in the second procedure?!










Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>