Groups | Blog | Home
all groups > sql server (alternate) > may 2004 >

sql server (alternate) : Can There be a single Index


vinay bhushan
5/7/2004 4:16:44 AM
Can we make a Index on 2 or more tables

Table a:
Col1 int
col2 varchar

Table b:
Col1 int
col2 varchar

can you have a single index for two tables a and b on the column Col1.
Is this possible in SQL-Server.

As far as i know you can make an index only on one Table.

can the index be shared by two tables?
index y which is created is shared by
table a , table b and table c

I like the idea of a union an putting it in a veiw and having a index
but i dont want to make 100 views for a special index.

first of all i want to know wether the index is only on one table can be
on multiple tables.



*** Sent via Developersdex http://www.developersdex.com ***
sql NO[at]SPAM hayes.ch
5/7/2004 5:25:26 AM
[quoted text, click to view]

No - an index exists on one table (or indexed view) only. If you have
a specific indexing problem, then you could post more details and
someone may be able to suggest a solution.

Erland Sommarskog
5/9/2004 10:10:47 PM
vinay bhushan (bhushanvinay@mail.com) writes:
[quoted text, click to view]

By means of an indexed view, yes.

What an indexed means in practice is that you materialize the view,
so it still really one table under the covers. But you don't have
the chores to keep it updated. SQL Server takes care of that for you.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
sunderlandfan NO[at]SPAM hotmail.com
5/10/2004 1:06:47 AM
Is your question because of a particular problem? Are you getting a
performance issue joining the two table together?

Alicia

AddThis Social Bookmark Button