Hi everyone. I want to execute a stored procedure from my vb code with a string variable, and create a new table in my database and name the table based on that variable.

I tried the following, but the table was named EFS_@dteYear

VB Code:
  1. Create procedure [dbo].[EFS_Table_Creator]
  2. @dteYear char(4)
  3. as
  4. Create Table dbo.EFS_@dteYear (
  5. pkey char(62) Null,
  6. location char(7) null)
  7. GO

I called this stored procedure like this.
VB Code:
  1. rs.Open "Exec EFS_Table_Creator '2004'"
Anyone know what I did wrong?

Thanks