Forum Replies Created

Viewing 15 posts - 9,946 through 9,960 (of 10,143 total)

  • RE: enhancing sql command

    JLSSCH (3/4/2008)


    All (especially Ralph):

    There are three JOIN clauses and only two ON clauses. Each JOIN clause should have a corresponding ON clause.

    Again, good luck all!!!!

    Nope, the joins are correctly...

  • RE: Could not create an acceptable cursor

    Nice bit of investigative work there, Tim. Who would have guessed it from the error message?

    Cheers

    ChrisM

  • RE: Could not create an acceptable cursor

    I'm sorry Tim. Better luck tomorrow.

  • RE: Could not create an acceptable cursor

    Aha! I think you want to do it this way round...

    UPDATE i SET catalogue_number = a.nwCode

    FROM [sage].cleaningnet.dbo.ImportTimStock i

    INNER JOIN ProductsWaitingApproval a

    ON a.sku COLLATE SQL_Latin1_General_CP1_CI_AI = i.product --COLLATE Latin1_General_CI_AS...

  • RE: INNER JOIN drags query

    Nice work, Srdjan! And...good point as always, Matt.

    It's not often that this technique actually speeds up a process; it's more useful as a tool for analysing and simplifying long, overcomplex...

  • RE: Could not create an acceptable cursor

    Grrr!

    Have you recorded the collation cast of a.sku and i.product?

  • RE: Could not create an acceptable cursor

    Hi Tim

    This should do it...

    UPDATE i SET catalogue_number = a.sku

    FROM [sage].cleaningnet.dbo.ImportTimStock i

    INNER JOIN ProductsWaitingApproval a

    ON a.sku = i.product COLLATE Latin1_General_CI_AS

    INNER JOIN [tmCleaningNet].dbo.products b ...

  • RE: Could not create an acceptable cursor

    Thanks for the prompt reply Tim. I've seen this error before doing the same i.e. updating a table on one server from another linked server, where the collation is different....

  • RE: Could not create an acceptable cursor

    Try this, Tim. If the SELECT works ok, then comment the SELECT and uncomment the UPDATE.

    --UPDATE i SET catalogue_number = a.sku COLLATE Latin1_General_CI_AS

    SELECT i.ImportTimStock, a.sku COLLATE Latin1_General_CI_AS

    FROM [sage].cleaningnet.dbo.ImportTimStock i

    INNER JOIN...

  • RE: HARD TO CREATGE SPECIAL VIEW

    eddy (3/3/2008)


    Hi Guys,

    I have managed to come to a solution in the following way,

    Can any expert please advice me if this is the right way to do this,

    SELECT ...

  • RE: INNER JOIN drags query

    Srdjan Svrdlan (3/3/2008)


    So did anyone have time to look at the execution plans?

    No, not yet, but playing with the code, it seems that this whole query could be "tamed" considerably...

  • RE: SUM divided by COUNT Issue

    You're welcome Ryan. If you're not already familiar with this type of structure - the inner SELECT - then read up on derived tables. The generally accepted term for the...

  • RE: Group by where MAX can be the same

    David Jackson (2/29/2008)


    Yes Chris, that's exactly what I was chasing down. 🙂

    I mean I knew you could do this without a correlated sub-query, but I was struggling...

  • RE: convert from MM/DD/YYYY to YYYYMMDD

    VAIYDEYANATHAN.V.S (10/25/2007)


    How to convert mm/dd/yyyy date format to yyyymmdd -

    try this!!!!!!!!!!

    http://www.pcreview.co.uk/forums/thread-1780991.php

    The link relates specifically to Excel and is of little or no use in this context.

  • RE: Group by where MAX can be the same

    Hi David

    I would use something like this 'cos it's quick...

    SELECT X.h_id, MAX(X.l_id), X.ton

    FROM #t1 X

    INNER JOIN (SELECT h_id, MAX(ton) AS MAXton FROM #t1 GROUP BY h_id) dt

    ON dt.h_id...

Viewing 15 posts - 9,946 through 9,960 (of 10,143 total)