August 6, 2005 at 12:06 am
Hai ....,
I have created a user defined type. It is of type varchar and size 50 not allowing null. When I try to use this data type for a local table variable as
DECLARE @CUST_TABLE TABLE ( RecID INT IDENTITY ( 1, 1 ), CustCode CustomerCode )
In the above declaration, CustomerCode is my user-defined data type. The error I encounter is as follows;
Error 2715: Column or Parameter #2: Cannot find datatype CustomerCode
How can I resolve this problem
August 6, 2005 at 2:38 am
Unfortunately, user-defined types cannot be used in table variables.
August 6, 2005 at 3:37 am
Ohhhh. OK thank you
August 6, 2005 at 7:47 pm
Hey it works in SQL2005; another reason to use it.
CREATE TYPE dbo.CustomerCode4 FROM varchar(11) NOT NULL ;
GO
DECLARE @CUST_TABLE TABLE ( RecID INT IDENTITY ( 1, 1 ), CustCode dbo.CustomerCode4 )
SELECT * FROM @CUST_TABLE
GO
Tim S
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply