Add a Key on MS SQLServer

[expired user #9806]'s profile image [expired user #9806] posted 7 years ago in General Permalink

In HS 8.3 I try to add a Key on a field and get SQL Error (1018) Incorrect syntax new 'INDEX'... So How can I create a Key with this tool?

Thank you,

kileywm's profile image kileywm posted 7 years ago Permalink

Same error.

From the query log:

ALTER TABLE "dbo"."DocumentItems"
    ADD INDEX "DocID" ("DocID");
/* SQL Error (1018): Incorrect syntax near 'INDEX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax. */
  • MS SQL 10.0
  • HeidiSQL 9.4.0.5125

I believe that it is missing something like:

WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)

Please login to leave a reply, or register at first.