CREATE PROCEDURE [dbo].[SubmitSearch2] (
     @p_UserName VARCHAR(128),
     @p_Name VARCHAR(128),
     @p_Criteria VARCHAR(MAX),
     @o_SearchID INT OUTPUT
    )
AS
    BEGIN
		--Insert new search record
        INSERT  INTO Search2
                (
                 UserName,
                 Name,
                 Status,
                 SubmitDT,
                 Criteria
                )
        VALUES  (
                 @p_UserName,
                 @p_Name,
                 1,
                 GETDATE(),
                 @p_Criteria
                );

		--Get assigned auto-ID
        SET @o_SearchID = SCOPE_IDENTITY();
    END