Hi Christopher, > In SQL Server, it seems it is not possible to specify the schema of > the database because the schema is bound to the user. Thus, > "Factory.use(Schema)" has no effect and all fields have the > "[schema]." prefix.
Yes. In the early days of jOOQ, this "naive" implementation of "USE" assumed that all RDBMS are the same as far as the concepts of database / catalog / schema / user are concerned. That is not the case of course, and so, the Factory.use(Schema) method might not make much sense in SQL Server, where "USE" is used for selecting databases, not schemata. > Wouldn't it be possible for jOOQ to remove that prefix if the default > schema of the connected user (as returned by "SELECT SCHEMA_NAME()") > is the one defined by "Factory.use()"? How would Factory.use() have to be changed in order to achieve that? I don't know SQL Server good enough... If you know what you're doing, however, you can generally remove the generated "[schema]" prefix by specifying new Settings().withRenderSchema(false); This is documented here. http://www.jooq.org/manual/ADVANCED/SchemaMapping/ > Please correct me if my understanding of database, users and schemas > in SQL Server is wrong. Probably it's my understanding that is wrong. jOOQ 3.0 will correct these things and properly implement all aforementioned objects correctly, according to the SQL standard. I hope to implement this in a way that jOOQ knows which qualifiers can be omitted and which ones have to be rendered, according to JDBC connection default values. Please let me know if this helps Cheers Lukas
