Hi the list,

On my DEV machine I'm using MySQL, I use the MappingTool Ant task and its all 
OK.
I produce the ddl sql file (for human reading) and also directly "inject" the 
schema using the MappingTool to the database (not using the generated sql file).

On PROD, I have to deal with SQLServer. I amended the ant script in order to 
connect using a URL specific to SQLServer. I rely on JTDS open source SQLServer 
JDBC driver.
JDBC connection is fine, but I got an error on the SQL, I have to modify it by 
hand to make it work.

I didn't try to specify a "dialect" in the ant script, should I ?
If yes, how ?

The error is on the constraint that are all named UNQ_ and it sound like a 
problem for SQLServer.
CREATE TABLE A (id BIGINT NOT NULL AUTO_INCREMENT<...>, PRIMARY KEY (id), 
UNIQUE UNQ_ (id));
CREATE TABLE B (id BIGINT NOT NULL AUTO_INCREMENT<...>, PRIMARY KEY (id), 
UNIQUE UNQ_ (id));

If I correct the sql by hand like the following, it works :
CREATE TABLE A (id BIGINT NOT NULL AUTO_INCREMENT<...>, PRIMARY KEY (id), 
UNIQUE UNQ_1 (id));
CREATE TABLE B (id BIGINT NOT NULL AUTO_INCREMENT<...>, PRIMARY KEY (id), 
UNIQUE UNQ_2 (id));

I can't do it by hand for the real code for a lot of reason, I have to rely on 
MappingTool.

Any ideas ?

Reply via email to