Below is a snippet of my code, when the table name contains a hyphen, I get the error below. How can i fix this? Thanks for the help.
alt text http://img109.imageshack.us/img109/148/createtable.png
ex = {"ERROR [42000] [Microsoft] [SQL Server ODBC driver] [SQL Server] Line 1: invalid syntax next to '-'." }
Use []around the column name:
[]
CREATE TABLE [test2] (cn VarChar(1024) NULL, [tutor-id] VarChar(1024) NULL)
Or it is advisable to stick to column names that do not require special handling ...
, , , .
[tutor-id]
, , [tutor-id], tutor-id, tutorId - , .
tutor-id
tutorId
SQL . tutor : [tutor-id]
[].
Try:
CREATE [test2] ( [cn] varchar (1024) NULL, [tutor-id] varchar (1024) NULL )
Source: https://habr.com/ru/post/1725848/More articles:How to disable import library generation? - visual-c ++Downgrade ClickOnce app - clickonceTake a few arguments in an AS3 method - methodsBest way to read rapidshare API response? - c #How to use the RapidShare API to get account information? - apiSupport for Apache 2 Windows rotatelogs - loggingHow to get key events while dragging and dropping? - javaMemory version of Java FileChannel in memory - javaXSL Conversion and XML Special Objects, - xmlThemes or processes? Having data-independent tasks, which is better to use? - cAll Articles