I have a Table Type defined in a database. It is used as a table-valued parameter in a stored procedure. I would like to call this procedure from another database, and in order to pass the parameter, I need to reference this defined type.
But when I do DECLARE @table dbOtherDatabase.dbo.TypeName
, it tells me that The type name 'dbOtherDatabase.dbo.TypeName' contains more than the maximum number of prefixes. The maximum is 1.
How could I reference this table type?
Cross-database user-defined types seems to work only for CLR-based types. See this forum and MSDN (plus comments).