Need help on sp they will fire me from job

  • Please view the attached files it contains create table script which contains data also and there is one query which I have written for you to give you a result set. I need to generate a stored proc in which I have to pass values to two input parameter

    1st parameter name is @customer program

    2nd parameter name is @site program

    Values you can pass in these parameters are given below

    @site program= STORE

    @Customer program =STORE2

    “Script of total data” query shows me all records in which I can see the following

    ItemID, Itemprogrampricingid,price,quantity,points,Programcode

    Now the logic to implement IN this store proc is that , if I have itemid exists in both STORE AND STORE2 then my query will show me all the records of STORE2 (i.e. @Customer program)ONLY

    And IF the itemid does not exists in STORE AND STORE2 then my query will show the records of STORE (i.e. @Siteprogram)ONLY

    But I need all the records in one data set. Please help I don’t know why I am not able to build this logic please please please help me it will be easy for any one of you. :crying:

    MANY THANKS In advance

  • Duplicate thread, please stick to a single thread per question: http://www.sqlservercentral.com/Forums/Topic1586319-391-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • O comeon Gila. I am really trapped. Please help me 4 GOD sake

  • We're not here to do your job for you. If you're going to miss a deadline, tell your manager beforehand that you're behind. If you don't know T-SQL, then make sure he knows that so that he can consider getting someone else in who can.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I know its my job Gail. I am just asking for help , some times its hard to implement the logic. Or you can say my bad days are going on.

    Please don't get angry with me. I am just asking help.

    I am Sorry 4 my behaviour

Viewing 5 posts - 1 through 5 (of 5 total)

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