Suppose the following:
CREATE PROCEDURE [MySPROC]
AS
BEGIN
CREATE TABLE #tempSubset(
[MyPrimaryKey] [bigint] NOT NULL,
[OtherColumn] [int] NO
Solution 1 Use a table variable instead of a temporary table.
Solution 2 Use the Set FMTONLY off; SQL command in the procedure and you will get the column information to create a new complex type.
Solution 3 This is not a good way, but it's a very easy way. Just add a select statement with dummy data and it will not execute because 1=0.
you can check details on this link