I have a table type named EmpType with the following structure:
CREATE TYPE EmpType AS TABLE
(
ClientId UNIQUEIDENTIFIER,
EmployeeId INT,
Experience SMALLINT,
Age SMALLINT
);
This query ran successfully in the MS SQL Server.
Now that I try to construct another table using this table type it gives me an error.
CREATE TABLE EmpHashIndex2
(
HashIndex SMALLINT CONSTRAINT has_pk PRIMARY KEY,
TableName dbo.EmpType
);
After executing the above query it gives an error as:
The column "TableName" does not have a valid data type. A column cannot be of a user-defined table type.