I want to create a data type as a TABLE but I can’t use it in a local variable in my stored procedure (SQln Server 2008)
Create type myTableDataType as table
(
field1 int,
field2 int,
field3 varchar(100)
)
create Procedure myStoredProcedureTest
as
begin
declare @temporaltable as myTableDataType
.
.
.
.
end
in my declare sentence I got ann error "variable has an invalid data type"
Some idea where I’m wrong!!!
Thanks
Elaina
You need a table variable: