[Wrong Forum...] Create new table with variable passed to stored procedure from vb
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:
Create procedure [dbo].[EFS_Table_Creator]
@dteYear char(4)
as
Create Table dbo.EFS_@dteYear (
pkey char(62) Null,
location char(7) null)
GO
I called this stored procedure like this.
VB Code:
rs.Open "Exec EFS_Table_Creator '2004'"
Anyone know what I did wrong?
Thanks