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)
 Ordering by a specific element

Author  Topic 

pizzojm
Starting Member

20 Posts

Posted - 2001-10-26 : 12:20:43
Hello,

I am writing an update page where users can easily update users. The problem is I have a drop down box that shows the user's status. However, I want it to default to the user's current status and not a regular order. So if the user is currently of status 'management' then the drop down box will have management listed as the first selection in the list. I can do this with multiple SQL statments but I was curious if there was a way to do it easier, such as an ORDER BY etc.. that I am overlooking? Let me know! Thanks Much!

Here is the code...
(SQL SERVER 2000 ON WIN 2000 SERVER)

------------------
CREATE PROCEDURE spGetSpecificCustomerAccessLevels

@customerID INT,
@currentAccess INT

AS

--AccessLevel/AccessDesc are the fields I am concerned about

SELECT accessDesc, accessLevel, accessLevelID FROM tblAccessLevel WHERE customerID=@customerID

GO
------------------

   

- Advertisement -