I have this stored procedure which is working well;

```
ALTER PROCEDURE [dbo].[currentCoForHiLo] 
    @CoKeyCode Char(50)
BEGIN
    SET NOCOUNT ON;

    CREATE TABLE ##WrkedOnCo(cKeyCode Char(50), DateInt Int, HighValu Int, LowValu Int)

    CREATE CLUSTERED INDEX IDX_CI ON ##WrkedOnCo(DateInt)

    INSERT INTO ##WrkedOnCo 
        SELECT KeyCode, DateAsInt, HighValu, LowValu 
        FROM EODValuesAU 
        WHERE KeyCode = @CoKeyCode;
END

```

The procedure was getting data from one table `EODValuesAU`.

I now have multiple tables `EODValuesAU`, `EODValuesUS`, `EODValuesUK`.

I have tried altering the code to the following but the query now has errors. I want to use a variable for the table in the query. Is there any way I can do this. See altered code below;

```
ALTER PROCEDURE [dbo].[currentCoForHiLo] 
    @CoKeyCode Char(50), @CounrtyCode Char(10)
AS
BEGIN
    SET NOCOUNT ON;

    CREATE TABLE ##WrkedOnCo(cKeyCode Char(50), DateInt Int, HighValu Int, LowValu Int)

    CREATE CLUSTERED INDEX IDX_CI ON ##WrkedOnCo(DateInt)

    INSERT INTO ##WrkedOnCo 
        SELECT KeyCode, DateAsInt, HighValu, LowValu 
        FROM 'EODValues' + @CountryCode 
        WHERE KeyCode = @CoKeyCode;
END

```