Q:

Unable to create a table type on SQL Server 2005

I have created a type defined as following:
CREATE TYPE [dbo].[TypeListingDatePrice] AS TABLE(
    [RowID] [int] NULL,
    [ListPrice] [int] NULL,
    [SoldPrice] [int] NULL,
    [PendStatusDOM] [int] NULL,
    [ListingDate] [int] NULL,
    [StatusDate] [int] NULL,
    [PendDate] [int] NULL,
    [SaleDate] [int] NULL
)

This works fine on SQL Server 2012, but I unable to do the same on SQL Server 2005. It gives an error on execution:

Msg 156, Level 15, State 1, Line 1
  Incorrect syntax near the keyword 'AS'.

A:

The ability to create a user-defined table type was first introduced in SQL Server 2008 and so it is not possible to do this in 2005.
See the answer to this question:
https://stackoverflow.com/questions/2606263/how-to-create-a-table-type-in-sql-server-2005

