ALTER proc [dbo].[stp_tshrGetTestimonialsAdminList](
@id varchar(100),@title varchar(100)
)
As
If(@ID=0)
BEGINSELECT tshrResort.Title, tshrTestimonial.*
FROM tshrTestimonial INNER JOIN
tshrResort ON tshrTestimonial.tshrResortID = tshrResort.ID
ORDER BY tshrTestimonial.DateModified DESC
END
ELSE IF(@id=null)
BEGIN
SELECT tshrResort.Title, tshrTestimonial.*
FROM tshrTestimonial INNER JOIN
tshrResort ON tshrTestimonial.tshrResortID = tshrResort.ID
ORDER BY tshrTestimonial.DateModified DESC
END
ELSE
BEGIN
SELECT tshrResort.Title, tshrTestimonial.*
FROM tshrTestimonial INNER JOIN
tshrResort ON tshrTestimonial.tshrResortID = tshrResort.ID
WHERE tshrTestimonial.tshrResortID=@id
ORDER BY tshrTestimonial.DateModified DESC
END
GO
No comments:
Post a Comment