this my script
CREATE UNIQUE INDEX [RELBFM].[UQ_PMT_PMTNAME] ON [RELBFM]. [ISMPMT] ("PMTNAME" ASC);
following errors occur
where i am facing problemSyntax for a create index statement:CREATE UNIQUE NONCLUSTERED INDEX ix_t_name_c_name_nu_nc
ON schema_name.t_name (c_name ASC)
Spot the diff ;)|||The original is correct for Oracle, but indexes in SQL Server are assumed to be part of the table's schema. In fact, the "index owner" is not even a concept in SQL Server.|||[QUOTE=pootle flump]Syntax for a create index statement:CREATE UNIQUE NONCLUSTERED INDEX ix_t_name_c_name_nu_nc
ON schema_name.t_name (c_name ASC)
Spot the diff ;) [/QUOso
so when we use CLUSTERED AND NONCLUSTERED INDEX
I had used clustered primary key so what type of index should I use|||Actually the clustered\ nonclustered bit is not mandatory. I just like to put it in so it is explicit. It also appears that there was a copy and paste problem (apologies) - there should be a space between nonclustered and index. The difference was actually as mcrowley said - you "qualified" the index name when you should not have.
A pk and a not null unique index are exactly the same as far as sql server is concerned.
No comments:
Post a Comment