I need to have a where statement similar to below, but I am not able to get it to work.
Can you please help me with this one.
DECLARE @UserName as varchar(59)
SET @UserName ='mb'
SELECT [UserID], [UserName], [FullName], [Password], [UserAccessID], [CompanyID], [UserRole] , [OwnCompanyID]
WHERE [CompanyID] = OwnCompanyID of @UserName