I have two store procedures, in one of them I want to get one field form my view that has a Date value.
In the another one which is called StoredProcedure
I want to convert the output value of first stored procedure to Hijri Shamsi Date:
This is my first stored procedure that gets the date column:
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
Now I don't know how to use the above code in second stored procedure and how can I return value of the GetExamDate Procedure
in the second procedure?!