• Try in this manner-

    create procedure test_sp

    AS

    BEGIN

    declare @count int

    Select @count = COUNT(*) from test

    RETURN @count

    END

    Declare @storevalue int

    EXECute @storevalue = test_sp

    SELECT @storevalue

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/