-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use SimpleJdbcInsert
with catalog name
#32124
Comments
Thanks for the report. We usually just use the schema and catalog names for metadata lookup, but I can see how that looks inconsistent. However, it's far from being obvious as some database may not support specifying a catalog this way. Why is the catalog necessary for MSSQL server here? |
We have one SQL Server instance but with two separate databases (designed as different catalogs). I could create two JDBC connections and use them, but that would involve distributed transactions, wouldn't it? So using the same JDBC connection to write into both catalogs, seemed like a "smart/simple" idea. |
SimpleJdbcInsert
with catalog name
That makes sense. If you get a chance to test |
Thank you very much, I tested with spring-jdbc-6.1.4-20240129.153252-63.jar and it works. |
I use spring 6.1.3 with MSSQL.
My code:
If I use this code, it generate the following SQL:
But I expected it to be:
I took a look at
TableMetaDataContext.createInsertString
which usesschemaName
andtableName
but doesn't usecatalogName
.If I use
SimpleJdbcCall
withwithCatalogName
, it works.The text was updated successfully, but these errors were encountered: