And to all experts here.. I'm a newbie to stored procedures.

I really need help, my problem is, is it possible to used a parameter as databasename

Below is my sample:

```
ALTER PROCEDURE [dbo].[SP_EventLogs]
    (@HRTable as varchar(50))
AS
BEGIN
    Set NOCOUNT ON

    SELECT
        a.*,LOG_ADDBY.ADDBY 
    FROM
        EVENT_VIEWER a
    INNER JOIN 
        (SELECT 
             PK, (Lastname + ', ' + Firstname + ' ' + ExtName) as ADDBY 
         FROM 
             @HRTable.[dbo].[EMP_RECORDS]) LOG_ADDBY ON a.PerformBy = LOG_ADDBY.PK
    ORDER BY
        a.PerformDate DESC

    Set NOCOUNT OFF
END

```

`@HRTable` is my parameter.. and it returns an error.

Any suggestion would be greatly appreciated.

Thank you...