Hi All, I have the following table:SN date GCG SN date GS SN date CS_name SN date PN_name1 12/23/2011 Goal Control Gate 23 12/23/2011 GOAL SECTION 56 12/17/2014 Cold Section 76 12/19/2011 Paint_ SECTION
Is it possible to get the values of this table based on a particular parameter so for e.g, If I pass "GOAl Control gate" as a parameter then can I get the value of SN, Date for "GOAl Control gate" . if the parameter value is "GOAl Control gate" and "GOAl Section" then I want the value of SN, date for both "GOAl Control gate" and "GOAl Section".I will be passing the value as comma delimited stringDECLARE @SECTION varchar(200)I can pass the value as Goal Control Gate, GOAL SECTION to this stored procedure and get the SN and date for Goal Control Gate, GOAL SECTION , I don't want the value of Cold section and paint section in this case. If I pass the value Goal Control Gate , GOAL SECTION, Cold Section then I need the SN and date for all three of them.I am using sql server 2005So I want something like this if I pass the value "Goal Control Gate" , "GOAL SECTION" in @Section parameter then I want the output like below in the same formatSN date GCG SN date GS 1 12/23/2011 Goal Control Gate 23 12/23/2011 GOAL SECTION
and if I am passing "Goal Control gate", "Goal Section", "Cold section" then I want the output like thisSN date GCG SN date GS SN date CS_name 1 12/23/2011 Goal Control Gate 23 12/23/2011 GOAL SECTION 56 12/17/2014 Cold Section
If I am passing "Goal Control gate", "Goal Section", "Cold section", "Paint Section" then I want the output like thisSN date GCG SN date GS SN date CS_name SN date PN_name1 12/23/2011 Goal Control Gate 23 12/23/2011 GOAL SECTION 56 12/17/2014 Cold Section 76 12/19/2011 Paint_ SECTION
Any help will be appreciated.