473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can There be a single Index

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 ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
3 1739
vinay bhushan <bh**********@mail.com> wrote in message news:<40*********************@news.frii.net>...
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 ***
Don't just participate in USENET...get rewarded for it!


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.

Simon
Jul 20 '05 #2
vinay bhushan (bh**********@mail.com) writes:
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.


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, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
Is your question because of a particular problem? Are you getting a
performance issue joining the two table together?

Alicia

http://www.sqlporn.co.uk :o)
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dan glenn | last post by:
(PHP4.3.4, GD2) How can I save a PNG using GD2 and insure that it saves as a palette-based (8-bit, 256-color) single-color transparancy?? Saving this way, I could be sure that an image loaded from...
2
by: Michaela | last post by:
Hi, there! We are in need of a control that would allow us to take data from multiple Word and Excel files and generate a single PDF output file. (Our system is written in Visual Basic 6.0.)...
2
by: vasanth kumar | last post by:
Hi, I have a problem in dealing with the return value of the SQL command. I know how to do, when SQL command returns Recordsets. But in my case it returns a single value. The following code fails...
1
by: CODA PBC | last post by:
We have one user who enters a transaction and then does a single row update (updates all columns but only one is changing - this is due to the way our sql is generated in the application), at this...
3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
3
by: Bill | last post by:
I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200...
7
by: Dave Hammond | last post by:
Hi All, I'd like to have indexed search capability on column A, column B, or columns (A,B) for a given table. According to the MySQL manual, a multi-column index of (A,B) will provide "leftmost...
1
by: Sonny | last post by:
Hi, Would like to know the performance differenece between Multi-column Index vs Single Column Indexes. Let's say I have a table with col1, col2, col3 along with a primary key column and...
5
by: 3bottles | last post by:
Hi, What i'm trying to write a code that would allow me change a single bit of a variable. So I've tried to store it in an array so that its possible for me to change a single bit of the variable by...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.