SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: SQL statement

  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL statement

    hi guys how do i do this SQL statements when a user typed in search text field in my ASP.net webpage? How do I 'chop' the typed-in phrases?

    examples:

    1. typed in phrase: marketing assistant jobs

    the resulting SQL statement should be:

    SELECT field1,field2
    FROM myTable
    WHERE CONTAINS(*, 'marketing AND assistant AND jobs')

    2. typed in phrase: public administration

    the resulting SQL would be:

    SELECT field1,field2
    FROM myTable
    WHERE CONTAINS(*, 'public AND administration')

    3. typed in phrase: SQL server full text search
    result would be:

    SELECT field1,field2
    FROM myTable
    WHERE CONTAINS(*, 'SQL AND server AND full AND text AND search')



    thanks for any ideas.

    .

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    this isn't a database question, because you must chop the input string before submitting the SQL statement to the database

    i'll report this thread and ask a moderator to move it to the .net forum
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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