Getting incorrect syntax while creating a table type in sql server 2008 R2

 I am trying to create a table type in sql server 2008 R2 for use in TVP in stored procs. But I am getting this error as

Incorrect syntax near the keyword 'AS'.

CREATE TYPE LocationTableType AS TABLE
( LocationName VARCHAR(50)
, CostRate INT );
GO

This is the MSDN example. Please help me in understanding what is going wrong.

July 7th, 2013 5:16am

Hi Pulkit,

That is perfect, i even tried myself it is working fine. Can you please check you do not have wild character before and after the query that may be causing the problem.

Free Windows Admin Tool Kit Click here and download it now
July 7th, 2013 5:27am

Looks like  you connected to SS2005 server or the database is set 80 or 90 compatibility level
July 7th, 2013 5:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics