Click here to Skip to main content
16,020,811 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i created a table
SQL
CREATE TABLE [dbo].[SalesHistory]

 (


       [SaleID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,


       [Product] [varchar](10) NULL,


       [SaleDate] [datetime] NULL,


       [SalePrice] [money] NULL

 )

and tried to create a type for the same table with the fallowing
SQL
CREATE TYPE SalesHistoryTableType AS TABLE
 (


       [Product] [varchar](10) NULL,


       [SaleDate] [datetime] NULL,


       [SalePrice] [money] NULL


 )

but getting an error as
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS'
can any one tell me wat is the wrong
Posted
Comments
Sunny_Kumar_ 29-Jan-14 2:50am    
hey, it works fantastic here, are you selecting partial query?
Karthik_Mahalingam 29-Jan-14 3:48am    
which version of SQL you are using ??

1 solution

hi Shrikant...It work perfectly...
User-defined table types were introduced in SQL Server 2008. Possibly you are connecting to a SQL Server instance whose version is lower.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900