Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Incorrect Syntax near INCLUDE

Author  Topic 

mjkajta
Starting Member

1 Post

Posted - 2009-06-04 : 06:19:07
Hi,

I'm try execute the following query on a sql 2000 database
CREATE NONCLUSTERED INDEX [_dta_index_STOCK_TRAN_MASTER_6_1794105432__K12_K4_K6_2] ON [dbo].[STOCK_TRAN_MASTER] 
(
[TENDERED] ASC,
[SALES_TYPE] ASC,
[INVOICE_NO] ASC
)
INCLUDE ( [DELIVERY_DATE]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]
but get the following err msg.
Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near 'INCLUDE'.


Can anyone tell me what the reserved word for INCLUDE is on sql 2000, it does seem to work on sql2005 though.

Many Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-04 : 06:28:02
Include is not for SQL Server 2000 at all, and for the syntax to work in SQL Server 2005, you also must set the compatibility level to 90 or higher.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-04 : 13:07:31
included columns was a new feature introduced in sql 2005

http://www.sqlteam.com/article/included-columns-sql-server-2005
Go to Top of Page
   

- Advertisement -