I have a problem with my SQL script, please help me.
Example:
I have inserts:
INSERT INTO CUSTOMER (Code, Date) VALUES (1, GETDATE());
When I run this insert, reconfigures the following message:
"Msg 1934, level 16, state 1, HENRIQUE-PC server, line 5 INSERT failed because the following SET parameters are incorrect: 'QUOTED _IDENTIFIER . Make sure the SET parameters are correct for use with indexed views and / or indexes on calculated columns and / or filtered indexes and / or queries notificatio ns and / or XML data type methods and / or spatial index operations. ".
Now that I have used SET QUOTED_IDENTIFIER ON , my insert has completed successfully.
Example:
SET QUOTED_IDENTIFIER OFF GO INSERT INTO CUSTOMER (Code, Date) VALUES (1, GETDATE()); SET QUOTED_IDENTIFIER ON GO
(1 row (s) affected)
What is the relationship between GETDATE() and QUOTED IDENTIFIER ?
Why do I need to use QUOTED IDENTIFIER in this case?
I believe this is due to getdate. Why?
Thanks.
Enrique Melicio
source share