Provide a reliable way to get SQL Server Collation for a column in SqlDataReader
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 72
Description
### Is your feature request related to a problem? Please describe.
It is not currently possible to get the collation of a column out of a SqlDataReader. This was helpful as a followup of #1208 which allows getting raw bytes of a column and a collation would help interpret it.
Also see https://stackoverflow.com/questions/35190858/how-to-get-the-collation-of-string-fields-in-a-result-set-via-sqldatareader
### Describe the solution you'd like
I'd like some method to get this metadata. I am currently not sure which is the best way to do it, maybe extend `GetColumnSchema` or introduce a `GetCollation` method on SqlDataReader.
### Describe alternatives you've considered
1. Use database metadata
Does not work with stored procedures. Though there is `sp_describe_first_result_set`, this is quite limited; eg Temporary tables do not work.
2. Use some config from the user
This is an option, but wrong config would lead to bugs that are very hard to find (as it may work if using characters from 0-127 only). Also, it's duplicate information as SqlClient need the Collation anyway.
Contributor guide
Assessment
This issue has not been assessed yet.