0
Ikke en bug

SQL Server Model with column name of Order adds quotes

Kindler Chase 10 år siden opdateret af Rafał Strzaliński (Senior Engineer) 10 år siden 6
When adding a table for SQL Server and with a column name of Order, the generated SQL incorrectly adds quotes around the column name:

-- tables-- Table: OrderTest
CREATE TABLE OrderTest (
 "Order" int NOT NULL,
 Value varchar(250) NOT NULL
)
;

The generated SQL should be using brackets:

-- tables-- Table: OrderTest
CREATE TABLE OrderTest (
[Order] int NOT NULL,
 Value varchar(250) NOT NULL
)
;

I haven't tried other key words; if you fix this, I'd suggest testing other key words as well.

Thanks!
GOD, JEG ER TILFREDS
Tilfredshedsangivelse af Kindler Chase 10 år siden
AFAIK MS SQL Server supports both way of quoting names. We're using quotes (""). This is the facto standard among other database engines. Maybe there is a difference between "" and [] that we don't know.
I was using the auto-generated SQL from Vertabello and the quoted "Order" caused an error with SQL Server 2012. I'm not entirely sure what the entire scenario was, but when I manually updated to [Order], everything ran fine. A bit of research and it appears that QUOTED_IDENTIFIER must be enabled to allow the double quotes, otherwise, brackets must be used.
According to this document https://technet.microsoft.com/pl-pl/library/ms174393.aspx QUOTED_IDENTIFIER is enabled by default. Please check if you didn't changed sth by an accident. We would like to stick to the "default" behaviour and don't put the "set quoted_identifier on" statement into generated script.

Let's us know what did you found.
I've tried to reproduce the setup I defined in the SQL that prompted this topic, but have been unsuccessful. And I have never set anything with quoted_identifier in the current database. I think this can be closed as not reproducible. Thanks for looking into it!

Kundesupport af UserEcho