Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2004, 03:24 AM
Authorized User
 
Join Date: Nov 2004
Location: delhi, delhi, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default search in sqlserver

i have a large book database and i want to search based on the isbn no
but there is no primary key in my table how can i make a search fast

pl suppy with detail answer
thanks in adv



 
Old November 15th, 2004, 03:30 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

add an index to the table for the column isbn

Regards
Ganesh
 
Old November 15th, 2004, 03:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Why not identify a primarykey on that table? How about using ISBN as primary key field? Is that duplicated in the table?

But still an index on ISBN Number column would make that fast.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 15th, 2004, 03:38 AM
Authorized User
 
Join Date: Nov 2004
Location: delhi, delhi, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

pl specify the cmd for creating the indexing when there is no primary key will it make the search fast or it will effect the other operation like insert/update etc

 
Old November 15th, 2004, 03:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You could check for command in Bools online. Search for CREATE INDEX

Or the same can be achieved from Enterprise manager.

I don't think that would have a major hit on the performance when indexed on this, unless it contains duplicate ISBNs.

But explain why is that you don't want to create a primary key?

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 15th, 2004, 04:13 AM
Authorized User
 
Join Date: Nov 2004
Location: delhi, delhi, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

we don't have duplicate ISBN's but still it takes lot of time for
select isbn from books -->
now suppose i create an isbn as primary key will it effect the speed
we have 20lac of data
if yes then again the indexing is reqd pl specify with command


 
Old November 15th, 2004, 04:32 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Since you dont have duplicate ISBN's, why dont you create a primary key on that column and also a Clustered index on the same. That will make searching a lot more fastor. Setting the appropriate fill factor will also help in improving the performance

Regards
Ganesh
 
Old November 15th, 2004, 05:24 AM
Authorized User
 
Join Date: Nov 2004
Location: delhi, delhi, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thnks
it works
i have created isbn as a primary key now i want to search on basis of title or any other field say publishername
which indexing should i use for title/publishername and how to write the sql statement for it
thanks


 
Old November 15th, 2004, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

It is adviced to have an index in each of the columns involved in the "Where" clause.

Regards
Ganesh
 
Old November 15th, 2004, 07:08 AM
Authorized User
 
Join Date: Nov 2004
Location: delhi, delhi, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how to create index on more than one col
Is that indexing will only non clust
please write the statement for it
thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
New text search doesn't preselect search string planoie Visual Studio 2005 0 July 23rd, 2007 06:47 AM
SQLserver 2000 vs SQLserver 2005 Express cJeffreywang BOOK: Beginning ASP.NET 2.0 and Databases 0 April 22nd, 2007 09:52 AM
File Search / Indexing Search with .net 2.0 maulik77 ASP.NET 1.0 and 1.1 Basics 2 March 15th, 2007 12:45 AM
Search Engine for Full-text Search Kala ASP.NET 1.0 and 1.1 Professional 2 August 29th, 2004 02:16 AM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 09:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.