1

I have some C# code that creates an Access Database and a sql script that creates the tables and populates them from a C# DataSet object. One of the tables has a column on it named Memo. In Access, Memo is a reserved word so my sql script fails.

Unfortunately I cannot change the name of the column, but I need my sql script to be able to create this table. Is there something (like a symbol) I can add to the column name to get it to work?

I have tried single and double quotes, but that just names the fields 'Memo' and "Memo" and I don't actually want the quotes in the name. Here is part of the script that I am running to create the table.

CREATE TABLE Print_Vehicle (ID Int, Memo VarChar)

The error I get is

Syntax Error in field definition

4

1 回答 1

3

您可以使用方括号解决此问题:

[Memo] VarChar

尽管官方建议是“使用不同的名称”。

于 2013-07-02T19:34:43.580 回答