I have a SQL Server table, whose name is like Vers-xxx_yyy
.
As you can see, there is a character "-".
I don't know why this table was made so, but I have to load it from datastage job.
So when I run my job, I obtain error "table doesn't exist". I use odbc stage.Directly on SQL Server it is possible to use syntax [Vers-xxx_yyy]
, but not in datastage.
This db already exists and it is used by other applications.
Is there a way to开发者_运维技巧 avoid/resolve the problem?
Try using double quotes over the table name. Also it is good practice not to use hyphen, instead you can use underscore
Try using a backslash \ to escape the - character - Vers\-xxx_yyy
.
You should be able to put the table name in this form on the ODBC Connector too: [Vers-xxx_yyy]
Another solution would be to inform the SQL to query this table: SELECT * FROM [Vers-xxx_yyy]
精彩评论