How can I handle Key words in column Names?
Foe example if I have the column name as KEY...when I run the job it's giving me the following error.
Dynamic_RDBMS_6: [DataDirect][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'KEY'.
By the by I am loading fron DB2 ===>SQL SERVER.(DRS STAGE)
Also is they any way to handle Special characters in the column names (EX:#).
Thanks
How can I handle Key words in column Names?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
KEY is, of course, a reserved word (PRIMARY KEY, FOREIGN KEY). Therefore to use it as an identifier, such as a column name, you need to enclose it in double quote characters.
Code: Select all
SELECT DORR_ID, "KEY", QTY FROM tablename;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.