Search Stored Procedure

  • Hi,

    I am an inexperienced SQL programmer and need to write a SP which will be used to search a Call table within a Call Logging System used to log support calls for my company. The search criteria are fields like Call Reference No, Logged By, Call Status etc

    The problem I have is that individual or a combination of these criteria may be used to search on -can anyone advise how I can write a SP which will take account of the possible combinations of parameters which may be passed to the SP

    i.e. if 2 fields are populated during the search and 4 are empty

    Thanks,

    Stephen

  • There are a lot of similar threads around. Try the search for 'Search Engine'. This should give you a fair amount of information.

  • There are threads. Two differnt philosphies.

    1. Build dynamic sql statement and execute it.

    2. Prebuild stored procs for each combination. Call these from one central proc based on parameters passed in.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply