How to use a data type (table) defined in another database in SQL2k8?

Victor Rodrigues picture Victor Rodrigues · May 20, 2010 · Viewed 8.9k times · Source

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?

Answer

devio picture devio · May 20, 2010

Cross-database user-defined types seems to work only for CLR-based types. See this forum and MSDN (plus comments).