p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   SQL Server 2005 (http://p2p.wrox.com/sql-server-2005-220/)
-   -   Incorrect syntax near 'AutoresponderID' (http://p2p.wrox.com/sql-server-2005/89120-incorrect-syntax-near-autoresponderid.html)

LadyHawke January 10th, 2013 07:51 PM

Incorrect syntax near 'AutoresponderID'
 
I am still learning Classic ASP and SQL. I am trying to import data from a CSV file into a SQL 2005 table. The ASP page works fine until I try to upload the file. When I upload the file the first row of data is seen and held in the record set and then it produces this error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'AutoresponderID'.

/admin/Spitfire/Import1SCExportFiles/ImportAutoresponderList.asp, line 107

I know the error is not in the ASP page as another import routine uses this same code with only the variable names being different AND because AutoresponderID is not mentioned in the ASP.
AutoresponderID is a field name in the SQL table and is mentioned in the stored procedure.
Where is the syntax error? Here is the stored procedure:

Code:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ImportAutoresponderIDList_Insert]
 @FileName varchar(255)
 , @AutoresponderID int
 , @AutoresponderName varchar(255)
AS
BEGIN
        SET NOCOUNT ON

        INSERT INTO ImportAutoresponderIDList
        (
        [FileName]
        , [AutoresponderID]
        , [AutoresponderName]
        )
        SELECT
        @FileName
        , @AutoresponderID
        , @AutoresponderName
END

Thank you for your help.

LadyHawke January 17th, 2013 02:05 PM

Found my own solution
 
Found my own solution.

The error was not a syntax error in the store procedure.
It was in the ASP code.


All times are GMT -4. The time now is 10:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.