A column of database type "geometry" results in two extra columns hidden from ssms If I create a table like
create table test2 (foo geometry)

foo will show up in the table designer as expected

but when I query sys.columns for column information...
select
t.name as TABLE_NAME,
c.name as COLUMN_NAME,
c.precision as PRECISION,
c.scale as SCALE,
c.max_length as MAX_LENGTH,
c.is_nullable as IS_NULLABLE,
ty.name as DATA_TYPE
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
JOIN sys.types ty on c.system_type_id = ty.system_type_id and ty.NAME != 'sysname'
ORDER BY c.column_id

...I also got a columns of the types hiearchyid and geography (using the same column name).

Why?
Can I change my sys.columns query to filter out those pseudo columns?
(I am using that query to recreate a create table query).
use this query instead:
select
t.name as TABLE_NAME,
c.name as COLUMN_NAME,
c.precision as PRECISION,
c.scale as SCALE,
c.max_length as MAX_LENGTH,
c.is_nullable as IS_NULLABLE,
ty.name as DATA_TYPE
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
JOIN sys.types ty on c.user_type_id = ty.user_type_id and ty.NAME != 'sysname'
ORDER BY c.column_id

the join is based on the user_type_id so the results are the same as the GUI.