Click here to Skip to main content
16,005,099 members

Thangaraj P.V. - Professional Profile



Summary

    Blog RSS
3
Debator
6
Organiser
217
Participant
0
Author
0
Authority
0
Editor
0
Enquirer
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralCreating Headers in SQL Server Stored Procedure Pin
Thangaraj P.V.16-Jul-04 19:22
Thangaraj P.V.16-Jul-04 19:22 

I have the database tables similar to the below




Table 1: Elements


Fields Name  Data Type
Parent_Element_Id  Integer
Element_Id  Integer
Element_Name  Varchar



Table 2: Reports


Fields Name  Data Type
Report_ID varChar
Report_Description varChar
Stores_Id varChar
Month_Start_Date DateTime
Month_End_Date DateTime


Table 3: Reprots_Detail

Fields Name  Data Type
Report_ID DateTime
Element_ID Integer
Element_Value Double




for Example, I have the values in database like this below...



Table Name: Reports


Report_ID
Report_Description  Stores_Id  Month_Start_Date  Month_End_Date
R0001  aaaaaaaaaaaaaaaaaa  S00001  01-20-2004 02-19-2004
R0002  ssssssssssssssssss  S00002  01-20-2004 02-19-2004
R0003  dddddddddddddddddd  S00002  02-20-2004 03-19-2004
R0004  ffffffffffffffffff  S00001  02-20-2004 03-19-2004
R0005  gggggggggggggggggg  S00001  03-20-2004 04-19-2004
R0006  hhhhhhhhhhhhhhhhhh  S00003  01-20-2004 02-19-2004
.........        



Table Name: Elements





Parament_Element_Id 
Element_Id  Element_Name
0 1 Anabond
0 2 Bobin
0 3 Coolent
1 11 Anabond 202
1 12 Anabond 101
1 13 Anabond xxx
3 31 Water/Gel Based
3 32 Oil Based
32 321 xxxxxxx
32 322 yyyyyyy
32 321 zzzzzzz
........    





Table Name: Reports_Detail





Report_Id
Element_Id  Element_Value
R0001  321  43
R0001  322  23
R0001  323  54
R0001  11  110
R0004  321  23
R0004  322  55
R0004  11  643
R0004  12  500
.........    


 


my table values are like this.




I want to write the stored Procedure and display the values such that, my SP will not have the headers as column 

name of tables. but I want to have like



if Store_Id = S00001 selected, then



my SP should give the the value like





Parament_Element_Id 
Element_Id  Element_Name R0001  R0004  R0005 ......        
0 1 Anabond
0 2 Bobin
0 3 Coolent
1 11 Anabond 202 110  643 
1 12 Anabond 101 500
1 13 Anabond xxx
3 31 Water/Gel Based
3 32 Oil Based
32 321 xxxxxxx 43  23
32 322 yyyyyyy 23  55
32 321 zzzzzzz 54
........

Any one please help me out in making out this Stored Procedure.



Thanx and Regard,

Tthangaraj P.V.
tthangarajpv@yahoo.com

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.