Forum Replies Created

Viewing 15 posts - 916 through 930 (of 1,183 total)

  • RE: Using LIKE

    Not really, it's just that sometimes you are too close to a problem to see it clearly.

    ______________________________________________________________________

    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: Using LIKE

    ... AND Left(Zip, 5) IN ('98101','98104','98154')

    🙂

    ______________________________________________________________________

    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: Can this be done without a cursor?

    Actually I was refering to the execution plan diffs. 

     

     

    EDIT: Oh, and I agree with you on the previous...

    ______________________________________________________________________

    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: Can this be done without a cursor?

    Just for **** and giggles, I created a function zeroIsMinimum to handle the negative numbers and see how this affected performance. I got some pretty unusual results. now this may...

    ______________________________________________________________________

    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: tallying values in columns of each row

    This should get you going. The challenge for you now is to understand HOW this works


    DECLARE @table TABLE (someID INT IDENTITY(1,1),...

    ______________________________________________________________________

    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: Can this be done without a cursor?

    This will work ....


    UPDATE i

        SET qty_on_hand =

            CASE WHEN qty_on_hand - (SELECT COUNT(*) FROM @workTable w WHERE w.partno = i.inv_ID) < 0 THEN 0

           ...

    ______________________________________________________________________

    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: Can this be done without a cursor?

    Yeah, but I don't account for negative values .....

    Gimmie a minute though .....

    ______________________________________________________________________

    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: Can this be done without a cursor?

    Sorry, I missed the part about making negative results equal 0.

    ______________________________________________________________________

    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: Can this be done without a cursor?

    Oh, and whatever you need in the WHERE clause.

    ______________________________________________________________________

    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: Can this be done without a cursor?

     

    UPDATE i

        SET qty_on_hand = qty_on_hand - (SELECT COUNT(*) FROM @workTable w WHERE w.partno = i.inv_ID)

        FROM @I_master i

    ______________________________________________________________________

    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: How to take SSRS Off-line or redirect users?

    No need to cross post..

    Create an aspx page that either shows your message or redirects to the Default.aspx of reporting services depending on the time of day. Set that as...

    ______________________________________________________________________

    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: How to take RS Off-Line or redirect users?

    Create an aspx page that either shows your message or redirects to the Default.aspx of reporting services depending on the time of day. Set that as your default page in...

    ______________________________________________________________________

    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: Help with Table Update which contains duplicate rows

    FYI to all, V posted more detail in PM. Below is the script that gave him the desired results...


    /*

        SQL to create the temp tables for my testing...

    ______________________________________________________________________

    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: Help with Table Update which contains duplicate rows

    Is there a Primary Key on this table? What is it? Please provide DDL.

    ______________________________________________________________________

    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: SQL Challenge!

    Here's another way to skin the cat ....

     

    Your table is "dbo.challenge"

     

    SELECT

        colA

        ,SUM(colB)

    FROM

        (SELECT

            a.colA

            ,colB...

    ______________________________________________________________________

    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 - 916 through 930 (of 1,183 total)