Avatar of marrowyung
marrowyung
 asked on

Column, parameter, or variable #1: Cannot find data type dbo.booking_key.

hi,

right now moved to a new MSSQL  test server, but when I do this:

IF Object_id('tempdb..#datasource') IS NOT NULL
DROP TABLE #datasource;
CREATE TABLE #datasource
(
booking_key [dbo].[booking_key] 
);

Open in new window


it said :

Msg 2715, Level 16, State 7, Line 5
Column, parameter, or variable #1: Cannot find data type dbo.booking_key.

that type dbo.booking_key really exists.

any reason for that?
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
marrowyung

8/22/2022 - Mon
marrowyung

ASKER
type must be in tempdb?
ASKER CERTIFIED SOLUTION
Arifhusen Ansari

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
tks.
marrowyung

ASKER
tks and even I google it
Your help has saved me hundreds of hours of internet surfing.
fblack61
marrowyung

ASKER
hi,

one thing, if I restart that SQL server, do I need to rebuild all customized data type again ?
Arifhusen Ansari

Yes. Any type created in the Temp db will be vanished once you restart your server.
marrowyung

ASKER
then how can we make it all appear again once SQL server restarted?

create that in model DB ?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Arifhusen Ansari

Yes you can do that. But that type will be created for all new data base you will created after that.
marrowyung

ASKER
yes! I think about that too. so other than that, no other method but just  keep creating each time we restart the SQL server?