Správná syntaxe pro vytvoření unique indexu je:
create unique nonclustered index IX_tabulka_stlpec on tabulka (stlpec)
Pro typ ntext, ale nelze klíč založit. Musel by to být nvarchar. Viz SQL Server Books OnLine: Columns that are of the large object (LOB) data types ntext, text, varchar(max), nvarchar(max), varbinary(max), xml, or image cannot be specified as key columns for an index. Also, a view definition cannot include ntext, text, or image columns, even if they are not referenced in the CREATE INDEX statement.
|