Skip to content

Invalid check for database in connection string in _bulkcopy #442

@saurabh500

Description

@saurabh500

Describe the bug

A clear and concise description of what the bug is.

If you are seeing an exception, include the full exceptions details (message and stack trace).

The database keyword in connection string is optional. In its absence the client sends an empty database name and server responds with the database which the client was connected to. This default DB has been master.

In _bulkcopy we have a check to error out if the DATABASE in the connection string is not specified.

https://github.com/microsoft/mssql-python/blame/f8a6ca130e80d7180395e0e20a1c01e11641f38a/mssql_python/cursor.py#L2630C9-L2634C14

This needs to be removed.

The impact is that a connection string without database (though rare but possible), allows an ODBC connection, but the same connection string wont allow a bulk copy operation.

Please remove this check.

Metadata

Metadata

Labels

triage neededFor new issues, not triaged yet.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions