Forum Replies Created

Viewing 15 posts - 31 through 45 (of 67 total)

  • RE: Sql QUERY Help

    Ok, this is my final version:

    create table #tmp(orderId int, ProductGroup varchar(50));

    --insert into #tmp(orderId , ProductGroup , groups_bought)

    with myCTE(orderId,ProductGroup, groups_bought)

    as

    (

    select orderId

    , ProductGroup , count(ProductGroup) groups_bought

    from #OrderDetail detail

    inner join #Product prod

    on prod.productid=detail.productid

    group...

  • RE: Sql QUERY Help

    The query below should give you all the orders that have products from more then 1 group.

    with myCTE(orderId,ProductGroup, groups_bought)

    as

    (select orderId

    , ProductGroup , count(ProductGroup) groups_bought

    from #OrderDetail detail

    inner join #Product prod

    on prod.productid=detail.productid

    group...

  • RE: Sql QUERY Help

    Hey Rathna,

    I have tried to condense what you need to do below.... Pls post the output after running the select query.

    There may be too much data: just post the first...

  • RE: data block

    Please do your home-work yourself....

    PS: 😛

    Jeff was right!

  • RE: Sql QUERY Help

    Please provide sample scripts.... to create schema and insert data.

    Read guidelines using the link below (How to post)

    thanks,

  • RE: Insert Select with DEFAULT column

    I would say - since you are in any case going to modify the scripts, why not change the 'select *' also.

    The advice above makes eminent sense...

  • RE: Insert Select with DEFAULT column

    Just a thought - Would SSIS help here?

    The user obviously has a LOT of data to load. But using SSIS would mean they don't need those scripts anymore.

    I think the...

  • RE: Insert Select with DEFAULT column

    They are not that bad ... afaik triggers in sql server dont work on individual inserts in a transaction...

  • RE: Insert Select with DEFAULT column

    Aargh .... I just tested a sample table - even with a trigger you will probably need to change the scripts.

    Otherwise the Select * is failing...

    Any gurus with a better...

  • RE: Insert Select with DEFAULT column

    I have not done something like this ... but I would guess you would need to define some triggers on insert...

  • RE: sql code to divide header value based on number of detail records

    Shoot..... I forgot to divide by the count in my script....

  • RE: sql code to divide header value based on number of detail records

    You extinguished my desire to help you by the fact that you did not provide sample scripts.

    And this is not the first time you are coming on this forum ....

    Anyways...

  • RE: Update column3?

    Please read the guidelines on posting queries.

    You need to provide sample script to recreate the table and insert data in to it.

    Having said that, this should suffice in your case:

    update...

  • RE: WHILE loop issue

    In that case the only thing I would suspect is the location parameter that is being passed.

    Via the ASP page there is a certain value that is making the loop...

  • RE: WHILE loop issue

    I dont see lot of information to go on.

    You say that the SP works when you see in query analyzer - but we do know that it works 99 times

    from...

Viewing 15 posts - 31 through 45 (of 67 total)