Link to home
Start Free TrialLog in
Avatar of angus_young_acdc
angus_young_acdcFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to update this stored procedure?

As a follow on from my previous question (accepted before asking this!), how could I do an inner join on the status?  

https://www.experts-exchange.com/questions/24287818/How-To-Create-This-Stored-Procedure.html?anchorAnswerId=24047918#a24047918

The dbo.Users.Status will be 7, but in the UsersTypes table 7 means "Administrator".  How can I do a join for my where clause so that if the status number (which is a row ID) ever changes it won't cause an issue.  EG having something like:

WHERE(dbo.Users.Status = dbo.UsersTypes.Code = "Administrator"

Or however you would do a join on that.
ASKER CERTIFIED SOLUTION
Avatar of udaya kumar laligondla
udaya kumar laligondla
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of angus_young_acdc

ASKER

Thanks :)