Hey,
Can I have a ix_Index in one table and another ix_Index in another table in SQL Server?
I get an error that the indx already exists?
Can't you have 2 indexes with the same name in different tables in SQL Server?
Thanks,
Printable View
Hey,
Can I have a ix_Index in one table and another ix_Index in another table in SQL Server?
I get an error that the indx already exists?
Can't you have 2 indexes with the same name in different tables in SQL Server?
Thanks,
Indexes are not stored 'in' the table. They're stored together. So, no, you should have different names.
what's the proper naming conventions for indexes then?
mendhak_indexname.
:D
Actually, there's no as-such proper convention, but I've usually seen
something_index or index_something
I tend to include the table name and column names in my Index names, sometimes paraphrasing the table/column names if there are very many:
ix_tablename_columnname
You cannot have two objects with the same name.
a table and an index cannot have the same name in a single db.
Naming convention for indexes
Usually it is like
TableName_nIX
where n is a number
if it is PK index then
tablename_PK