Forum Replies Created

Viewing 15 posts - 541 through 555 (of 1,183 total)

  • RE: is there any other alternative to write this query

    SELECT

    km_ndc

    ,CASE WHEN SUM(extended_amount_corrected)

    + SUM(qty_corrected)

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: is there any other alternative to write this query

    Not really a better way to write that, but you could replace the AND's with + and test to see the performance difference.

    SELECT

    km_ndc

    ,CASE...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: ISNULL vs. COALESCE - which to use?

    My rulle of thumb is regardless of what "everyone says" is best to run both ways and compare the results. Then you'll know for sure. 😀

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Random Phone numbers

    Matt Miller (4/17/2008)


    Try something like this...

    select RIGHT('1234567890'+cast(cast(9999999999*rand(checksum(newid())) as bigint) as varchar(10)),10)

    OK, that just blows the pants off mine. :hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Random Phone numbers

    Something like this should mix up your numbers ... you may have to run it a couple of times to verify that you get all records.

    WITH startingList

    AS (SELECT

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Return value after executing stored procedure

    User RETURN

    ALTER PROCEDURE [Video].[addVideo]

    @Title nvarchar(50),

    @uri-2 nvarchar(200)

    AS

    BEGIN

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Arithmetic overflow in 9.00.3054

    Not Arith Abort, but Numeric Round-Abort

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Arithmetic overflow in 9.00.3054

    You have "Numeric Round-Abort" set to True on the 3054 DB. Change it to false and it will run without a hitch.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Pivot Tables

    That would explain it. It's because you add in another element to the Pivot without aggregating it. You'll need to remove that column from the results or comma delimeted list...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Looking for NOT Distinct Values

    LOL, I've been called worse.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: COUNT not working

    Read up on NULL in BOL ...

    Select Count (Distinct ConsultantID) from @t

    Where DeactivationDate = '2007-09-04'

    And ISNULL(StatusID, '') <> '72HOURRESIGNATION'

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Pivot Tables

    Really? IT works on my Adventure works DB just fine.

    Are you using the EXACT code I posted?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Pivot Tables

    I hate to be the bearor of bad news Andras, but your query produces a cartesean product. :ermm: Your query returns some 3000 rows, and mine is the original 64....

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Pivot Tables

    You essentially need to run the pivot two seperate times and join on the product name. This may not be the most efficient way of solving your problem, but this...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Looking for NOT Distinct Values

    Jeff Moden (4/9/2008)


    Heh... nice job there "Joel" 😛

    Hey, who the heck is this Joel guy? :hehe:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 541 through 555 (of 1,183 total)