Closed bloukanov closed 3 years ago
Hi @bloukanov ,
Seems like mssql stores uniqeidentifier in 16-byte GUID, which is a number and will be represented as a string of hexadecimal digit. I tried using both mssql-cli
client and pymssql
driver, they all show the lowercase result.
If you want to get an uppercase result, one way is to convert the type into a string, for example:
select CONVERT(VARCHAR(50), test_uuid) as test_uuid from table
It will return the uppercase result
thanks @wangxiaoying it is actually easy enough for me to do df.id.str.upper()
after the download. just wanted to bring it up! pd.read_sql downloads it in upper case
thanks @wangxiaoying it is actually easy enough for me to do
df.id.str.upper()
after the download. just wanted to bring it up! pd.read_sql downloads it in upper case
I think it depends on the underlying driver. In my case through pd.read_sql
, using pymssql
engine (https://docs.sqlalchemy.org/en/14/core/engines.html#microsoft-sql-server) the result is in lower case.
Actually we do not produce this string by ourselves but only get the value from the underlying Rust driver (https://docs.rs/tiberius/0.6.5/tiberius/). Seems like there is no regulation on this case (C# in lowercase and JDBC in uppercase), so I will close this issue for now. But thanks for bringing it up anyway!
@wangxiaoying ah I see, got it!
Hi,
I find that uniqueidentifier fields are being downloaded in lower case from MS SQL - do you see the same issue?