Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Stored Proc

Stored Proc

Scheduled Pinned Locked Moved Database
databasealgorithmshelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alok_2k3
    wrote on last edited by
    #1

    Hi, I am developing a web page for searching user records from DB. In advance search option there are 5 fields like firstname, lastname, years of experience,experience type, location. I want to write a storedprocedure which take all these 5 parameter as input and return me record from a table.All these fields are in single table. User can search a record by providing all the 5 fields are by providing any of these. Plz help me in writing this query. I am very week in T-Sql. Thanks in Advance Alok.... Alok...

    M A 2 Replies Last reply
    0
    • A alok_2k3

      Hi, I am developing a web page for searching user records from DB. In advance search option there are 5 fields like firstname, lastname, years of experience,experience type, location. I want to write a storedprocedure which take all these 5 parameter as input and return me record from a table.All these fields are in single table. User can search a record by providing all the 5 fields are by providing any of these. Plz help me in writing this query. I am very week in T-Sql. Thanks in Advance Alok.... Alok...

      M Offline
      M Offline
      Mark Churchill
      wrote on last edited by
      #2

      Write a stored procedure that takes the values you want. Pass the value the user is searching for, or null if no value on that column Then your query can look like: select * from sometable where (ColumnA = @SearchFieldA or @SearchFieldA is null) and (ColumnB = @SearchFieldB or @SearchFieldB is null) etc

      Mark Churchill Director Dunn & Churchill Diamond Binding: Zero to Data Layer in 3 mins

      1 Reply Last reply
      0
      • A alok_2k3

        Hi, I am developing a web page for searching user records from DB. In advance search option there are 5 fields like firstname, lastname, years of experience,experience type, location. I want to write a storedprocedure which take all these 5 parameter as input and return me record from a table.All these fields are in single table. User can search a record by providing all the 5 fields are by providing any of these. Plz help me in writing this query. I am very week in T-Sql. Thanks in Advance Alok.... Alok...

        A Offline
        A Offline
        alok_2k3
        wrote on last edited by
        #3

        Thanx Mark

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups