Stored Procedure

RedLeader
04-20-2004, 06:22 AM
Hello
I try to create table in SQL 7 with Stored procedure
CREATE PROCEDURE [CreateDataTable]

@FileName varchar (50),
@FieldName varchar(50),
@FieldNameValue varchar(10),
@CreateDataTable varchar(50)

AS
SELECT @FileName .* INTO @CreateDataTable FROM @FileName WHERE @FieldNames= @FieldNameValue

I call this from the Function
But this give me error: Invalid object name '@FileName'
Public Function CreateDataTable(filename As String, FieldNames As String, FieldNameValue As Integer) As String
connection.Execute ("CreateDataTable @FileName=" & filename & ", @FieldName=" & filename & ", @FieldNameValue=" & FieldNameValue & ", @CreateDataTable=" & CreateDataTable & " ")

any suggestions?

Thank you
RL

KnooKie
04-20-2004, 06:42 AM
just a thought..................

have you tried renaming filename in VB or SQL Server in case it is a reserved word ?

MKoslof
04-20-2004, 07:18 AM
How are you creating this table? I tend to create the table within the stored procedure, like so:



SET NOCOUNT ON
CREATE TABLE #MyTable (
ID int PRIMARY KEY NOT NULL,
myText nvarchar(1000) NOT NULL,
myText2 nvarchar(200) NOT NULL
)



etc....

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum