denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.82k stars 499 forks source link

Is There Support For SQL Server's hierarchyid data type? #792

Open clattan opened 10 months ago

clattan commented 10 months ago

I have a SQL Server file table and it contains some columns that have a data type of hierarchyid. Whenever I execute a query that returns one of the hierarchyid columns in the result set, I get an error stating, "not implemented makeGoLangScanType for type 240". I can execute the query inside of the SQL Server Management Studio and it returns the hierarchyid columns as hex values. Is there a way to handle these hierarchyid columns so the raw value is returned, in the same way that SQL Server Management Studio handles them? One of the columns represents a path locator and is the primary key of the file table, so I need a way to reference it as a foreign key in other tables.