Instead of stored procedure you can use function.
you can return value from function.
CREATE FUNCTION dbo.HasPrimaryKey (@TableName nvarchar(255))
RETURNS INT
AS BEGIN
DECLARE @result int
SET @result = 0
select @result = 1
from sysobjects
where xtype = 'D';
and parent_obj = object_id(@TableName)
RETURN @result
END