Search code examples
sql-server-2008user-defined-types

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


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?


Solution

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