Need help with creating StoreProc

  • Hi all, I'm new to SQL, any instructions or sample code to create the Store Proc below would be greatly appreciated.

    Find below the details.

    Requirement: create SP to validate the city and zip combination.

    Step 1: validate zip vs state code

    Step2 : if the above condition pass, then verify the zip code vs city

    2 different errors for both cases.

    Table name: Zips

    Columns: Zip, City, StateCode, County.

    Note: this proc need to accect 3 parameters zip, city, and state

    Thanks,

    SueTons

  • For homework help, the standard on the forum has usually been that you should give it a try first and then ask for help where you get stuck.

    But a couple of questions come to mind. How are the errors to be communicated? Is a message printed at proc end sufficient, or should a SQL Server error be raised with the appropriate description of the error? How is success ( a valid zip-city-state combination) to be indicated? A result set consisting of a message or a return value from the proc?

    HINT: you might look up IF EXISTS() for an beginning.


    And then again, I might be wrong ...
    David Webb

  • This is the same thing Lynn is asking for on the other thread. Please don't double post.

    Replies should go here:http://www.sqlservercentral.com/Forums/Topic1313354-391-1.aspx


    And then again, I might be wrong ...
    David Webb

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

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