DatabaseMetadata methods with catalog parameters now error if current database does not match.


in v1.2 ctp version, databasemetadata methods getting information objects in database (i.e. gettables(), getcolumns(), ...) errors if current database connection in different database object quering. 

is intended behavior going forward?

in case have access both database , database b.  current connection in database , looking object in database b.

 resultset rs = conn.getdatabasemetadata.gettables("b","dbo","%",{"tables" });


    [junit] database name component of object qualifier must name of current database.
    [junit] com.microsoft.sqlserver.jdbc.sqlserverexception: database name component of object qualifier must name of
 the current database.
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverexception.makefromdatabaseerror(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement.getnextresult(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement.doexecutestatement(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement$stmtexeccmd.doexecute(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.tdscommand.execute(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverconnection.executecommand(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement.executecommand(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement.executestatement(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverstatement.executequeryinternal(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverdatabasemetadata.getresultset(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverdatabasemetadata.getresultset(unknown source)
    [junit]     @ com.microsoft.sqlserver.jdbc.sqlserverdatabasemetadata.getcolumns(unknown source)



~mike hale

i see there bug filed issue via microsoft connect:

http://connect.microsoft.com/sqlserver/feedback/viewfeedback.aspx?feedbackid=277128

 

we will investigate , prioritize accordingly.  



SQL Server  >  SQL Server Data Access



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........