Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ORDER BY Clause passeb by Parameter

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-09-20 : 07:22:44
Sergio Sánchez writes "Hello Team,

I need to pass the Order By clause by parameter to a Stored Procedure.

The clause will receive always 5 fields.

How can I do this? I had tried with a CASE but its only valid for one field.

Thanks in advance.

Regards!"

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-09-20 : 07:36:03
If you are using single parameter to specify ORDER BY fields then you will have to use Dynamic SQL

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

uberman
Posting Yak Master

159 Posts

Posted - 2006-09-20 : 07:59:49
Alternatively try

[url]http://groups.google.co.uk/group/microsoft.public.sqlserver.server/msg/b22b971ac561a5d1?hl=en[/url]
Go to Top of Page
   

- Advertisement -