Search book by title, and author

Posted by Swoosh on Stack Overflow See other posts from Stack Overflow or by Swoosh
Published on 2010-06-02T10:36:22Z Indexed on 2010/06/02 10:54 UTC
Read the original article Hit count: 349

I got a table with columns: author firstname, author lastname, and booktitle Multiple users are inserting in the database, through an import, and I'd like to avoid duplicates. So I'm trying to do something like this: I have a record in the db: First Name: "Isaac" Last Name: "Assimov" Title: "I, Robot"

If the user tries to add it again, it would be basically a non-split-text (would not be split up into author firstname, author lastname, and booktitle) So it would basically look like this: "Isaac Asimov - I Robot" or "Asimov, Isaac - I Robot" or "I Robot by Isaac Asimov"

You see where I am getting at?

(I cannot force the user to split up all the books into into author firstname, author lastname, and booktitle, and I don't even like the idea to force the user, because it's not too user-friendly)

What is the best way (in SQL) to compare all this possible bookdata scenarios to what I have in the database, not to add the same book twice. I was thinking about a possibility of suggesting the user: "is THIS the book you are trying to add?" (imagine a list instead of the THIS word, just like on stackoverflow - ask question - Related Questions.

I was thinking about

 soundex

and maybe even the

 like

operators, but so far i didn't get the results i was hoping.

© Stack Overflow or respective owner

Related posts about sql-server-2005

Related posts about search