CREATE procedure [dbo].[up_get_second_pass] @bcust_id nvarchar(50) as set nocount on if exists (select AuthID from AuthTable with (nolock) where WindyCode = @bcust_id) begin select second_pass from AuthTable with (nolock) where WindyCode = @bcust_id return; end select ''; return @@error