End column

3 views
Skip to first unread message

ioani

unread,
Sep 14, 2009, 7:02:03 AM9/14/09
to dbfit
Hi,

I have a table that has a column named 'End'.
When I tried to insert a value in that column:

!|Insert|MyTable|
|col1|col2|End |
|11 |22 |33 |


I received the following error:

Insert
--------------------------------------------------------------------------------

System.Data.SqlClient.SqlException: Incorrect syntax near the keyword
'End'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning
(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader
(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds
(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean
returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader
(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean
returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery
(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at dbfit.fixture.Insert.RunRow(Parse row) in D:\work\dbfit\impl
\dotnet\src\fixture\Insert.cs:line 78
at dbfit.fixture.Insert.DoRows(Parse rows) in D:\work\dbfit\impl
\dotnet\src\fixture\Insert.cs:line 51
at fit.Fixture.DoTable(Parse table)
at fitlibrary.FlowFixtureBase.ProcessRestOfTable(Fixture
theFixture, Parse theRestOfTheRows)

If I remove the column the insert works.

Gojko Adzic

unread,
Sep 14, 2009, 8:48:45 AM9/14/09
to dbfit
end seems to be a keyword in your sql dialect. Dbfit just creates
queries and forwards them to the database so you might need to escape
the column name with whatever the escaping syntax is for your
database.

gojko

ioani

unread,
Sep 15, 2009, 4:43:46 AM9/15/09
to dbfit
Hi Gojko,

I am using SQL Server 2005. In test I surounded the 'End' column with
square brackets ([ ] escape syntax for Sql Server) but I got the same
error.

Thanks,
Ioani
Reply all
Reply to author
Forward
0 new messages