Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: Unable to query xml data in sql server Date: Wed, 10 Jun 2020 21:55:03 +0200 Organization: Erland Sommarskog Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="a98af81c8a9a40563c8bdb2f0cf72939"; logging-data="11519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/w6xDyFPHn13p4ilwN4H+O" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:p7TVWxCn9PpIDT4R6BxC3VglVKw= Xref: csiph.com comp.databases.ms-sqlserver:2039 chris H (chris.sjpd@gmail.com) writes: > WITH > ( > AccidentReportNumber-AllPages varchar(20), > AddressFullText varchar(100) '/trafficunit/driver', > InjuredWas_driver int '/involvedPeople', > PedestrianActionA-AllPages int, > MotorVehicleInvolvedWithC-AllPages int, > CollisionOccurredDate-AllPages date, > Time-AllPages int > ) > > > Here is the error: > Msg 102, Level 15, State 1, Line 32 > Incorrect syntax near '-'. > The name you have to the left is a column name, and must follow the regular syntax for identifiers. Hyphen is not a permitted character in an identifier. You need to wrap these names in double quotes or bracket. These delimiters permits you to have about any column name. For instance: [PedestrianActionA-AllPages] int, "MotorVehicleInvolvedWithC-AllPages" int, "" and[] are equivalent. "" is the ANSI standard. [] is the Microsoft way.