Click here to Skip to main content
13,260,619 members (41,762 online)
   

Database

 
AnswerRe: [VB.net+ADO.net]how can combobox 1 control the result of combobox2 Pin
Achilles8430-Jan-13 4:47
memberAchilles8430-Jan-13 4:47 
QuestionSMO Retrieve Table Record Pin
savbace28-Jan-13 3:31
membersavbace28-Jan-13 3:31 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 3:42
mvpSandeep Mewara28-Jan-13 3:42 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 3:55
membersavbace28-Jan-13 3:55 
QuestionRe: SMO Retrieve Table Record Pin
Eddy Vluggen28-Jan-13 4:21
mvpEddy Vluggen28-Jan-13 4:21 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 4:22
mvpSandeep Mewara28-Jan-13 4:22 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 4:40
membersavbace28-Jan-13 4:40 
Questionhow can reporting in this Situation Pin
karimkpg26-Jan-13 3:38
memberkarimkpg26-Jan-13 3:38 
AnswerRe: how can reporting in this Situation Pin
Sandeep Mewara26-Jan-13 7:02
mvpSandeep Mewara26-Jan-13 7:02 
QuestionQuery to concatenate multiple rows based on sequence in results set Pin
Alex Lush24-Jan-13 23:43
memberAlex Lush24-Jan-13 23:43 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Eddy Vluggen25-Jan-13 2:51
mvpEddy Vluggen25-Jan-13 2:51 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Shameel25-Jan-13 4:20
memberShameel25-Jan-13 4:20 
GeneralRe: Query to concatenate multiple rows based on sequence in results set Pin
Alex Lush25-Jan-13 4:30
memberAlex Lush25-Jan-13 4:30 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
mmccarth25-Jan-13 6:21
membermmccarth25-Jan-13 6:21 
How about a temporary table:

create table #t2
(
    order_no          varchar(255),
    order_line_no     int,
    long_description  varchar(8000),
    done              bit
)
 
Insert	Into #t2 (order_no, order_line_no, long_description, done)
Select  order_no, 
        order_line_no, 
        long_description,
        0
From    #t1
Where   line_type = 'p'
 
Declare @i int
Set @i = 1
 
While (Select count(*) From #t2 where Done = 0) > 1
Begin
 
    Update  t2
    Set     t2.long_description = t2.long_description + ' ' + t1.long_description
    From    #t1 t1
    inner join
            #t2 t2
    On      t1.order_no = t2.order_no
    And     t1.order_line_no = t2.order_line_no + @i
    And     t1.line_type <> 'P'
    And     t2.done = 0
    
    
    Update  t2
    Set     t2.done = 1
    From    #t1 t1
    inner join
            #t2 t2
    On      t1.order_no = t2.order_no
    And     t1.order_line_no = t2.order_line_no + @i
    And     t1.line_type = 'P'
 
Set @i = @i + 1
 
End
 



You could also use a cursor.

Mike
QuestionSyntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 15:40
memberIgaBaro23-Jan-13 15:40 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Mycroft Holmes23-Jan-13 16:02
memberMycroft Holmes23-Jan-13 16:02 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 16:25
memberIgaBaro23-Jan-13 16:25 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 16:37
memberPIEBALDconsult23-Jan-13 16:37 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 17:16
memberIgaBaro23-Jan-13 17:16 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 17:26
memberPIEBALDconsult23-Jan-13 17:26 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 17:58
memberIgaBaro23-Jan-13 17:58 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 17:59
memberPIEBALDconsult23-Jan-13 17:59 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Richard MacCutchan24-Jan-13 0:22
mvpRichard MacCutchan24-Jan-13 0:22 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 6:48
memberPIEBALDconsult24-Jan-13 6:48 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 6:54
memberIgaBaro24-Jan-13 6:54 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 7:00
memberPIEBALDconsult24-Jan-13 7:00 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 8:11
memberIgaBaro24-Jan-13 8:11 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 8:56
memberPIEBALDconsult24-Jan-13 8:56 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Richard MacCutchan24-Jan-13 23:35
mvpRichard MacCutchan24-Jan-13 23:35 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 6:51
memberIgaBaro24-Jan-13 6:51 
Questioncreated tables not dropped in a transaction rollback Pin
Danzy8320-Jan-13 17:13
memberDanzy8320-Jan-13 17:13 
AnswerRe: created tables not dropped in a transaction rollback Pin
Mycroft Holmes20-Jan-13 17:32
memberMycroft Holmes20-Jan-13 17:32 
AnswerRe: created tables not dropped in a transaction rollback Pin
Eddy Vluggen21-Jan-13 3:06
mvpEddy Vluggen21-Jan-13 3:06 
AnswerRe: created tables not dropped in a transaction rollback Pin
Shameel21-Jan-13 23:08
memberShameel21-Jan-13 23:08 
GeneralRe: created tables not dropped in a transaction rollback Pin
jschell22-Jan-13 9:16
memberjschell22-Jan-13 9:16 
GeneralRe: created tables not dropped in a transaction rollback Pin
Shameel23-Jan-13 0:46
memberShameel23-Jan-13 0:46 
QuestionChange the language for Sql Server 2008 Pin
Thaer Hamael19-Jan-13 2:27
memberThaer Hamael19-Jan-13 2:27 
AnswerRe: Change the language for Sql Server 2008 Pin
PIEBALDconsult19-Jan-13 6:29
memberPIEBALDconsult19-Jan-13 6:29 
AnswerRe: Change the language for Sql Server 2008 Pin
Mycroft Holmes19-Jan-13 15:19
memberMycroft Holmes19-Jan-13 15:19 
Questionsql server 2008 Pin
Kapilkp18-Jan-13 0:25
memberKapilkp18-Jan-13 0:25 
QuestionRe: sql server 2008 Pin
Eddy Vluggen18-Jan-13 2:30
mvpEddy Vluggen18-Jan-13 2:30 
GeneralRe: sql server 2008 Pin
Kapilkp21-Jan-13 0:06
memberKapilkp21-Jan-13 0:06 
GeneralRe: sql server 2008 Pin
Eddy Vluggen21-Jan-13 2:15
mvpEddy Vluggen21-Jan-13 2:15 
GeneralRe: sql server 2008 Pin
PIEBALDconsult21-Jan-13 5:57
memberPIEBALDconsult21-Jan-13 5:57 
AnswerRe: sql server 2008 Pin
PIEBALDconsult18-Jan-13 5:01
memberPIEBALDconsult18-Jan-13 5:01 
Questionsql server Pin
yogika17-Jan-13 20:15
memberyogika17-Jan-13 20:15 
AnswerRe: sql server Pin
Eddy Vluggen18-Jan-13 2:37
mvpEddy Vluggen18-Jan-13 2:37 
AnswerRe: sql server Pin
Richard Deeming18-Jan-13 2:37
memberRichard Deeming18-Jan-13 2:37 
GeneralRe: sql server Pin
Eddy Vluggen18-Jan-13 3:13
mvpEddy Vluggen18-Jan-13 3:13 
GeneralRe: sql server Pin
Richard Deeming18-Jan-13 3:18
memberRichard Deeming18-Jan-13 3:18 

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.


Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 25 Nov 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid