on 2012 Feb 13 10:46 AM
We have just srarted an effort to move one of our app to sql server from sql anywhere. All my datawindows are failing because the sql for all datawindows has table and column names in double quotes but these double quotes will not work with SQL Sever, SQL server throws an error via odbc as soon as these datawindows are hit, I have hundered of datawindows that I will go in and remove these quotes one at a time, is there some way of searching and replacing these quotes massively? any help will be much appreciated.
Javed
From the SET QUOTED_IDENTIFIER documentation for MSS (http://msdn.microsoft.com/en-us/library/aa259228%28v=sql.80%29.aspx)
SET QUOTED_IDENTIFIER OFF GO -- Attempt to create a table with a reserved keyword as a name -- should fail. CREATE TABLE "select" ("identity" int IDENTITY, "order" int) GO SET QUOTED_IDENTIFIER ON GO -- Will succeed. CREATE TABLE "select" ("identity" int IDENTITY, "order" int) GO SELECT "identity","order" FROM "select" ORDER BY "order" GO DROP TABLE "SELECT" GO SET QUOTED_IDENTIFIER OFF GO
So it clear that MSS supports table and column names in quotes.
Please check your DelimitIdentifier DBParm setting. It will override the defaults in MSS and the ODBC driver. If you continue to have problems, you may want to ask this question in a PowerBuilder or MSS focused forum as there will be more users with experience with that combination of software.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank u everybody for your answers, however I was able to fix the problem after spending almost the entire day on it. In DB-Profile Setup under Syntax tab there is an option that allows putting quotes around table and column names. My SQL Anywhere profile had that checked and i did the same for SQL Server profile and it worked great. thanks to everyone. Yes SQL Server itself does not stop you from putting quotes around table and column names.
You should not have to do that... SQL Server is perfectly capable of handling "delimited" identifiers; see http://msdn.microsoft.com/en-us/library/ms174393.aspx
Check the ODBC DSN and make sure "Use ANSI quoted identifiers" is checked.
Good luck with all the other problems you're going to have with Transact SQL!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.