Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is There Support For The HierarchyID Data Type? #167

Open
clattan opened this issue Jan 3, 2024 · 3 comments
Open

Is There Support For The HierarchyID Data Type? #167

clattan opened this issue Jan 3, 2024 · 3 comments
Labels
Area - data types Issues related to data types bug Something isn't working

Comments

@clattan
Copy link

clattan commented Jan 3, 2024

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 they are returned 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.

@clattan clattan closed this as completed Jan 3, 2024
@clattan clattan reopened this Jan 3, 2024
@dlevy-msft dlevy-msft added bug Something isn't working Area - data types Issues related to data types labels Jan 3, 2024
@shueybubbles
Copy link
Collaborator

@clattan are you trying to scan to interface{} or to []byte ? Or does the target scan type not matter?

@clattan
Copy link
Author

clattan commented Jan 4, 2024

@shueybubbles , I've tried string and []byte and get the same result.

@shueybubbles
Copy link
Collaborator

@clattan If I'm reading the doc right, it seems you could just cast your value to varbinary in TSQL and it will return the equivalent of what SSMS is doing already. Is that not an option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - data types Issues related to data types bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants