Thursday, January 7, 2010

SQL Server UDTs

Msg 2715, Level 16, State 7, Procedure SPregInsertRegressionTop1Report, Line 70
Column, parameter, or variable #1: Cannot find data type DTObjectID.

Above error ocurred on CRPCORE db on my local computer. The UDT DTObjectID does exist in db CRPCORE (under Programmability.Types.User-defined Data Types).

Problem: UDTs must be known to SQL server before they can be used i.e these UDTs must also exist in model and tempdb databases. Im my case, esp tempdb because the SP above internally creates a table (with create TABLE) which, as we all know, gets created in tempdb.

Resolution: import these UDTs to model and tempdb.

No comments: