I have this stored procedure:
ALTER PROCEDURE [dbo].[getClassInfo](@ClassId int)
AS
BEGIN
SELECT [usergroupId]
,[gName]
,[accessCode]
FROM [dbo].[usergroup]
where usergroupid = @ClassId OR accessCode = @ClassId
END
Now, I want the parameter I'm sending to check either usergroupId
which is a number or accessCode
which is a string.
Which solution is painless to check for both cases using one parameter?