In sql server, I have a simple query that returns all users, both active & inactive. I need to update my query to provide the user with an option to show or hide inactive users. That user's value will be passed in via a parameter called "@ShowInactiveUsers" (BIT). I have a few ways of going about doing this, but I'm looking for the best way to set this up. So, in my below query, what's the best way to setup my WHERE clause so that if ShowInactiveUsers = false, then only show results where Active = 1. But if ShowInactiveUsers = true, then show all results?
DECLARE @ShowInactiveUsers bit = 1
SELECT UserId
, UserName
, FullName
, Active
FROM Users
WHERE
<insert active/inactive where clause here>