Solved

How do I get a record using sql using a secondary index

Posted on 2010-11-09
3
276 Views
Last Modified: 2012-05-10
I have a sql table with a secondary index.  This secondary index is also unique but uses multiple fields.  Using variables to find the one record, should I still use a sql select statement or is there a better way?  I am using C# in visual studio 2008. Yes, I am a beginner.
0
Comment
Question by:StuBabyAight
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
mkobrin earned 500 total points
ID: 34099420
Your SQL select query normally makes use of the indexes that are available based on the fields in the select statement by default, however you can force the index to be used. EG:

SELECT column_list FROM table_name WITH (INDEX (index_name) [, ...])

0
 

Author Comment

by:StuBabyAight
ID: 34099431
Great, I figured it was the most effecient way, but I wanted to check I hadn't missed an area of C# that allows me to get a single record.  Thanks!
0
 

Author Closing Comment

by:StuBabyAight
ID: 34099435
Thanks for the quick reply
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL server 2008 SP4 29 33
Long URL in SMS 6 24
backups - Strategies 1 13
COnsume rest client 6 8
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now