473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Incorrect syntax near 'QUOTED_IDENTIFI'

hi,
i am an external sql script that i called using sqlcmd from command prompt. However, an error appeared, "Msg 102, Level 15, State 1, Server db\SQLEXPRESS, Line 2
Incorrect syntax near 'QUOTED_IDENTIFI'."

Is there any software that i can use to validate the sql script ? i need more clear error description.

Expand|Select|Wrap|Line Numbers
  1. --[START EXPORT FILE : First line of script file]
  2. SET NOCOUNT ON
  3. GO
  4. SET QUOTED_IDENTIFIER ON
  5. GO
  6. SET IDENTITY_INSERT tbl_test ON
  7. GO
  8. ALTER TABLE tbl_test NOCHECK CONSTRAINT ALL
  9. ...
  10. ALTER TABLE tbl_test CHECK CONSTRAINT ALL
  11. GO
  12. SET IDENTITY_tbl_test OFF
  13. SET QUOTED_IDENTIFIER OFF
  14. GO
  15.  
  16. SET NOCOUNT OFF
  17. --[COMPLETE EXPORT FILE: Last line of script file]
Apr 22 '13 #1
6 2352
Rabbit
12,516 Expert Mod 8TB
And the SQL runs fine elsewhere?

The reason I ask is because line 12 looks wrong. I assume line 9 is just you collapsing the rest of the code.
Apr 22 '13 #2
Yes, the SQL runs without errors in MS SQL mgmt studio.
Line 9 is hidden as i am collapsing the rest of the code which are all INSERT statements.

Is line 12 wrong, what should be the correct answer?

Any good tool to recommend?


@Rabbit
Apr 23 '13 #3
oh.. line 12 should be, it's my typo error in the 1st msg
SET IDENTITY_INSERT tbl_test OFF
Apr 23 '13 #4
Rabbit
12,516 Expert Mod 8TB
Compare the equivalent on line 6 to line 12.
Apr 23 '13 #5
Expand|Select|Wrap|Line Numbers
  1. --[START EXPORT FILE : First line of script file]
  2. SET NOCOUNT ON
  3. GO
  4. SET QUOTED_IDENTIFIER ON
  5. GO
  6. SET IDENTITY_INSERT tbl_test ON
  7. GO
  8. ALTER TABLE tbl_test NOCHECK CONSTRAINT ALL
  9. ...
  10. ALTER TABLE tbl_test CHECK CONSTRAINT ALL
  11. GO
  12. SET IDENTITY_INSERT tbl_test OFF
  13. SET QUOTED_IDENTIFIER OFF
  14. GO
  15.  
  16. SET NOCOUNT OFF
  17. --[COMPLETE EXPORT FILE: Last line of script file]
  18.  
Other than Line 12, is there any other "incorrect" areas? coz line 12 is an error when i copied and paste to this textbox, i accidentally removed the word '_INSERT'.

or maybe i can send u my file and u can see exactly what i have? what's ur email address?
Apr 23 '13 #6
Rabbit
12,516 Expert Mod 8TB
We prefer that you post the code in the thread itself.
Apr 23 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Magouirk | last post by:
Dear Group, I am trying to create a view and keep getting the Incorrect syntax near the keyword 'Declare'" error. Here is the code I am writing. Create view fixed_airs (sid, fad_a2, fad_a3)...
4
by: Carl | last post by:
Can you tell me what is wrong with this syntax ? string select = "UPDATE .. " + "(,,,,,,, ,,,, ,,, , , , ) " + " VALUES (@id,@clientid,@total,@tps,@tvq,@gtotal,@datefac,@datepay,
1
by: Zoury | last post by:
Hi there! :O) I trying to use a COM DLL (made in VB 6.0) from C#... and it hasn't been working well for me this far.. :O/ I did a sample in VB 6.0 that used the DLL and it works great.. so now...
1
by: Sandesh | last post by:
Hello All, Me saying " has any body come across such error would be underestimating". Well I am getting a very peculiar and unique error "Line 1: Incorrect syntax near 'Actions'." ...
1
by: iporter | last post by:
In the following code, the two Response.Write statements output exactly the same - I can copy and paste both into Query Analyzer, and run them fine. However, if I comment out line 3, the...
3
by: wallic | last post by:
Hello, This is my first post and I am a beginner with SQL code. The code below is supposed to update a new table (loctable) with a calculated value based on the original table (hra_data). ...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
10
by: arial | last post by:
Hi, I am getting this error message: Incorrect syntax near the keyword 'where'. Description: An unhandled exception occurred during the execution of the current web request. Please review...
1
by: karenkksh | last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
1
by: Omendra | last post by:
Hi, I am using SQL Server 2005 and i am using Stored Procedure something like :- I am getting error:- Msg 170, Level 15, State 1, Line 18: Incorrect syntax near 'MAX'. DECLARE @jid AS...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.