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
Debasis Mohapatra
NA
381
56.6k
Out of four option choose the one answer agnist the question
Feb 22 2019 4:52 AM
I have three table
stype table,question table and the final table is fivesquestiondetails.
both the primay key id i have inserted in fivesquestiondetails table. Please check the my below store procedure code.
CREATE
PROCEDURE
[dbo].[questionrecords]
AS
SET
NOCOUNT
ON
BEGIN
BEGIN
TRY
BEGIN
select
distinct
q.question_name
as
'Question'
,qd.question_option
as
'Option'
,s.
name
from
[dbo].[five_s_question] q
inner
join
[dbo].[five_s_question_details] qd
on
q.id=qd.question_id
inner
join
[dbo].[five_s_sitetype] s
on
s.id=qd.stype_id
END
END
TRY
BEGIN
CATCH
DECLARE
@ErrorMessage
VARCHAR
(
MAX
);
SELECT
@ErrorMessage =
'There was a problem trying to Retrieve Course Type'
+
Char
(13) +
Char
(10) +
'The error was: '
+
Char
(13) +
Char
(10) + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1)
END
CATCH
END
--exec questionrecords
three tables
[dbo].[five_s_sitetype]
id, name, cbu, doc, mbu, dom
[dbo].[five_s_question]
id, question_name, weightage, stype_id, cbu, doc, mbu, dom, qstatus
[dbo].[five_s_question_details]
id, question_id, question_option, details_weightage, stype_name, stype_id, cbu, doc, mbu, dom
Reply
Answers (
4
)
Convertion of Year to month
Calculate age between current date and birthdate