I am trying to create a tool that will find User-Defined Table Types in a database on MS SQL Server that start with ABC and then create a new set of User-Defined Table Types that are identical, but with -X appended to the end of the name.
So, for instance, if I ran this theoretical tool on an existing SQL database that contains three UDT's named MyUdt, YourUdt, and ABCUdt, the result would be that the database would now contain four UDT's: MyUdt, YourUdt, ABCUdt, and ABCUdt-X.
This appears to be rather similar to a question about how to create a UDT that matches a table: Automatically generate a user defined table type that matches an existing table
I know that a SQL database contains the definition of each of its stored procedures as text and this can be queried on the sys tables, but it looks like there is no such definition stores for UDTs.
Before I go to the trouble to write code that will unravel an existing UDT into a statement to create a new UDT, can anyone tell me if there is a way to write a command that says, "Hey MS SQL Server, take the UDT ABCUdt and create another one exactly like it called ABCUdt-X"?
user defined table type, not a table. - Vivian River