You can look in sys.types or use TYPE_ID:
IF TYPE_ID(N'MyType') IS NULL ...
Just a precaution: using type_id won’t verify that the type is a table type–just that a type by that name exists. Otherwise gbn’s query is probably better.
You can look in sys.types or use TYPE_ID:
IF TYPE_ID(N'MyType') IS NULL ...
Just a precaution: using type_id won’t verify that the type is a table type–just that a type by that name exists. Otherwise gbn’s query is probably better.