Click here to Skip to main content
15,904,500 members
Home / Discussions / Database
   

Database

 
AnswerRe: Query regarding SP's Pin
sa.Eish12-Sep-06 22:59
sa.Eish12-Sep-06 22:59 
GeneralRe: Query regarding SP's Pin
ParagGupta12-Sep-06 23:34
ParagGupta12-Sep-06 23:34 
QuestionQuestion abt self joined tables Pin
Rocky#12-Sep-06 20:04
Rocky#12-Sep-06 20:04 
AnswerRe: Question abt self joined tables Pin
Stephen McGuire13-Sep-06 12:14
Stephen McGuire13-Sep-06 12:14 
QuestionA question abt making the main page of DB application Pin
Rocky#12-Sep-06 20:00
Rocky#12-Sep-06 20:00 
QuestionMultiple Record Set Pin
Amit Kumar G12-Sep-06 14:20
Amit Kumar G12-Sep-06 14:20 
AnswerRe: Multiple Record Set Pin
Not Active13-Sep-06 3:20
mentorNot Active13-Sep-06 3:20 
QuestionUrgent Need Help....Rows to Columns Pin
Amit Kumar G12-Sep-06 8:53
Amit Kumar G12-Sep-06 8:53 
Hi
I have three tables like parent and child and I don’t know in child table how many records can be. E.g.

[TB_ProductMaster]
[ProductId] [varchar] (4) NOT NULL ,
[ProductTitle] [varchar] NOT NULL ,
Many other fields

Data Looks like
A1 TV
A2 VCR
A3 HT

[TB_InstructionMaster]
[InstructionId] [int] IDENTITY (1, 1) NOT NULL ,
[InstructionDesc] [varchar] (50) NOT NULL

Data Looks like
1 “Always Top”
2 “Always Down”
3 “Always Left”
4 “Always Right”

[TB_ProductInstruction]
[Id] [int] NOT NULL ,
[ProductId] [varchar] (4) NOT NULL And FOREIGN KEY FOR PRODUCTID
[InstructionId] [int] NOT NULL

Data Looks like

1 A1 1
2 A1 2
3 A1 3
4 A1 4
5 A2 1
6 A2 2
(Please note here i don;t know the child count. e.g product can have one Instruction or can have n numbers of Instructions.)

Now i need output like for supplied product parameter as. This paramter will be input to SP.

Product Id InstructionDesc1 InstructionDesc2 and so on
A1 Always Top Always Down
A2 Always Top Always Down
A3 Null NULL
A4 NULL NULL

Here so on means , n number of columns can be....

I know by using LEFT OUTER join i can do the needful but only if I know the count in my child table. But in my case we don't know Frown | :( Moreover because of our company database standards we can not use CURSORS also....

We need to do this by using query or in worest case dynamic SQL...

PLEASE HELP ME……….PLEASE HELP ME……….PLEASE HELP ME……….


Amit
AnswerRe: Urgent Need Help....Rows to Columns Pin
Eric Dahlvang12-Sep-06 11:47
Eric Dahlvang12-Sep-06 11:47 
QuestionSQL Join problem! Pin
richiemac12-Sep-06 3:21
richiemac12-Sep-06 3:21 
AnswerRe: SQL Join problem! Pin
Eric Dahlvang12-Sep-06 4:06
Eric Dahlvang12-Sep-06 4:06 
GeneralRe: SQL Join problem! Pin
richiemac12-Sep-06 5:05
richiemac12-Sep-06 5:05 
Questiondaynamic sql Pin
yazan_zahi12-Sep-06 2:10
yazan_zahi12-Sep-06 2:10 
AnswerRe: daynamic sql Pin
Amit Kumar G12-Sep-06 16:17
Amit Kumar G12-Sep-06 16:17 
Questionnulls in a DataTable Pin
hamidreza_buddy11-Sep-06 23:44
hamidreza_buddy11-Sep-06 23:44 
AnswerRe: nulls in a DataTable Pin
_AK_11-Sep-06 23:56
_AK_11-Sep-06 23:56 
AnswerRe: nulls in a DataTable Pin
albCode13-Sep-06 4:15
albCode13-Sep-06 4:15 
QuestionCode Error! Pin
Shahzad.Aslam11-Sep-06 23:18
Shahzad.Aslam11-Sep-06 23:18 
AnswerRe: Code Error! Pin
_AK_12-Sep-06 0:23
_AK_12-Sep-06 0:23 
QuestionAbout cursor in sqlserver 2000 Pin
yazan_zahi11-Sep-06 22:57
yazan_zahi11-Sep-06 22:57 
AnswerRe: About cursor in sqlserver 2000 Pin
Marek Grzenkowicz12-Sep-06 0:14
Marek Grzenkowicz12-Sep-06 0:14 
GeneralRe: About cursor in sqlserver 2000 Pin
Amit Kumar G12-Sep-06 16:23
Amit Kumar G12-Sep-06 16:23 
GeneralRe: Can I use Dynamic SQL in While Loop Pin
gopisant15-Apr-09 20:11
gopisant15-Apr-09 20:11 
Questionfetch data from table Pin
senthilmca11-Sep-06 19:21
senthilmca11-Sep-06 19:21 
AnswerRe: fetch data from table Pin
_AK_11-Sep-06 19:26
_AK_11-Sep-06 19:26 

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.