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
saida chary
NA
24
1.2k
Sql server Order by according to sent params
Aug 17 2017 7:37 AM
I'm sending four id's to the database to get the four questions. and their respected multiple choice options. Everything is fine but when user filtered the questions by 'id', Order by functionality is disturbing. please suggest your code how to get order by through sent parameter.
For Example:
If I'm sending @CaseId VARCHAR(MAX)= '34559|34558|34557|34556'
o/p coming as 34556
34557
34558
34559
If I'm using order by desc the condition fails if the user is not filtered through 'id'. Issue when the user is filtered by 'id'. I want o/p as the sent parameters order not by default order even user filtered or not.
Note: If User selected filter option id's are changing vice versa means asc to desc and desc to asc
Thanks in advance.
Reply
Answers (
4
)
how to limit repeated value of a colunm in inserting values
What is Table Partitioning ?