Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Defined Data Types in Temporary Tables

Status
Not open for further replies.

balajees

Programmer
Apr 24, 2002
12
US
Hi,
I created a new User Defined Data type in my database.
In one of my StoredProcedures , I created a temporary table and used that data type for one of the fields.

On executing the stored procedure , it says cannot find that data type.

Can't user defined data types be used in temporary tables?

Balajees
 
Temporary databases are created in tempdb and the UDT is probably not defined in tempdb. Chances are you have created the UDT in a user database. You need to do one of the following.

1) Create the UDT in tempdb so it can be used in temporary tables. You'll need to do this each time SQL Server starts.
2) Create a "permanent temporary table" in the database where the UDT is defined.
3) Add the UDT to the Model database. It will then exist in tempdb (and all new databases) after restarting SQL Server. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top