I have created some user-defined types to be used as table-valued parameters. Is there any way I could select their columns, just like I can select columns for a table:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME LIKE 'MyTable'
Edit: yes, I tried to read MSDN, but I don’t see the information there. My current workaround is to create a permanent table as follows:
CREATE TABLE Placeholder(copy-and-paste all the columns from my type here)
Then I can select from INFORMATION_SCHEMA.COLUMNS and drop Placeholder when I am done.
This will give you a list of columns for the table type
TVPTest