SPEED! Stored Procedures And Searching...

Results 1 to 3 of 3

Thread: SPEED! Stored Procedures And Searching...

  1. #1
    ASP_DRUG_DEALER Guest

    Default SPEED! Stored Procedures And Searching...

    SQL 7.0<BR><BR>I have a db with 10k+ records in it and growing. What I am trying to do is write a search that will return a pretty close match on what was entered into a text box. I am dealing mostly with heavy equipment and really need it to search in a set order. First it needs to search by model number. If no matches are found, it then needs to search by description. Again if no matches are found, search by "make". This needs to happen all at once(Stored Procedure??). <BR><BR>What I have done so far is to take a string that someone enters and break it apart and search by each word ("CAT 988" = "cat" AND "988"). The problem with this is the SQL string can become huge and returns crazy results (also using wildcards).<BR><BR>What I am really trying to do is put a "band-aid" on this until the db can get reworked. The db has no domains, relations, ect....nothing just a bunch of varChar fields with about anything entered into them. They have tons of data, just nobody can find anything. <BR><BR>Any help would be great.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: SPEED! Stored Procedures And Searching...

    Ah yes, the importance of a good data model! Having a bunch of varchars is not a good data model, for many reasons, including the one you&#039ve stumbled upon! A poor data model leads to difficulty in scaling.<BR><BR>You are in luck, though! There are a series of wonderful articles on 4Guys that discusses, in depth, the process and importance of data modeling. Check it out at:<BR>http://www.4guysfromrolla.com/webtech/datamodeling.shtml<BR><BR>Happy Programming!

  3. #3
    Mirage Guest

    Default RE: SPEED! Stored Procedures And Searching...

    You could consider this sql string.<BR>sql = "SELECT * FROM TableName WHERE ModelNumber =&#039" & Request.Form("objName") & "&#039 AND Description = &#039" & Request.Form("objName") & "&#039 AND Make = &#039" & Request.Form("objName") & "&#039"<BR><BR>They have to have entered information in all of the text fields for this to work and your database must be set up correctly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •