Finding a SQL Server Data Type Dependency
2 answers
Tables are relatively simple, sys.columns and sys.types allow you to associate columns with types. The next request will get this.
select s.name
,o.name
,c.name
,t.name
from sys.schemas s
join sys.objects o
on o.schema_id = s.schema_id
join sys.columns c
on c.object_id = o.object_id
join sys.types t
on c.user_type_id = t.user_type_id
where t.name = 'Foo'
EDIT: As G Mastros showed above, you can get parameters with a similar query.
select s.name
,o.name
,p.name
,t.name
from sys.schemas s
join sys.objects o
on o.schema_id = s.schema_id
join sys.parameters p
on p.object_id = o.object_id
join sys.types t
on p.user_type_id = t.user_type_id
where t.name = 'Foo'
+1
source to share