June 29, 2009 at 3:57 am
I got into a strange situation. I tried to use covering-index using the INCLUDE keyword. But, I's invited with error:
"Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near 'INCLUDE'."
The Query I'm using is like:
CREATE INDEX IX_UpdateTime
ON Logs(UpdateTime)
INCLUDE (UpdateDate, UpdateId)
Can anyone suggest, where I went wrong?
Thanks.
---
.NET Developer
Blog: Did you say .NET?[/url]
Follow me on Twitter
June 29, 2009 at 4:06 am
As far as know you can't use the INCLUDE in SQL 2000
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
June 29, 2009 at 4:11 am
Strange if this is happening in SQL Server 2005 .
try this even though there is nothing special i have changed .
CREATE INDEX [rerer1] ON [dbo].[MyTable]
([Name] ASC)
INCLUDE ([ID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
Abhay Chaudhary
Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)
June 29, 2009 at 4:48 am
Compatibility mode 80?
Edit: Never mind. Ignore this. I misread the forum this was in.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 29, 2009 at 5:24 am
If you using 2000 you can't use include...
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
June 29, 2009 at 5:41 am
Add the columns in the index key. Not possible if there's lots or if they're of a type that can't be included.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 29, 2009 at 5:46 am
GilaMonster (6/29/2009)
Add the columns in the index key. Not possible if there's lots or if they're of a type that can't be included.
Thanks for the reply.
As you said, let me try the traditional way for adding Indexes.
🙂
---
.NET Developer
Blog: Did you say .NET?[/url]
Follow me on Twitter
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply