Forum Replies Created

Viewing 15 posts - 316 through 330 (of 4,080 total)

  • RE: query to stop running when a specific value in a row. odd request.

    I'm curious, since you have a customer number already to group on, why don't you just ignore type 'B' rows?

    WHERE t_col1 <> 'B'

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: how to remove leading 1 and zeros

    Or if your number is actually character data. 😀

    declare @number varchar(20) = '1000000017777'

    select @number as before

    select @number = RIGHT(@NUMBER,len(@number) - PATINDEX('%0[^0]%',@number))

    select @number as After

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: questions about sql

    I would while away the hours conversing with the flowers, discoursing with the rain....

    Toto, I don't think we're in Kansas anymore.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Only insert records where the new value differs from the current value

    Just out of curiousity, shouldn't the date also be greater than the latest date for that user? Or is that not a concern because you're always insterting the current...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Searching set of words by ignoring spaces

    ON needs to be on a different line in order to test if the code handle carriage returns/new lines correctly.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Do not SELECT if in Table B

    with JustInD as (select name

    from sys.server_principals db

    ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Do not SELECT if in Table B

    How about this?

    WHERE not exists (SELECT 1 from sys.server_principals where

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Executing dynamic functions in table select

    Jeff Moden (8/25/2016)


    The Dixie Flatline (8/25/2016)


    Sorry, but functions can't call procedures. They can only call other functions. Period.

    Any bets on that? 😉

    I'd probably lose the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Running Total with different categories

    If you are talking about simply filtering a resultset, then the code below will work without resorting to dynamic SQL.

    Declare @Region varchar(10), @SubRegion varchar(10)

    Set @region = 'USA'

    Set @SubRegion =...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: simple dynomic Transpose 2 column as 2 rows

    Thank you for doing an excellent job of setting up the problem for us. Good job. Looking at the problem all you really wanted to...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Error handling in my stored procedure

    Something like this?

    BEGIN TRY

    POST

    END TRY

    BEGIN CATCH

    POST IN ERROR

    END CATCH

    😉

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Seconds to hours??

    I'm wondering why you store staffed time in seconds. How much do you pay per second? 😛

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    I miss being coddled :crying:

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Hmmmm... maybe it's a trap site that employers sponsor to spoon-feed wrong answers to job applicants who don't know any better! 😀

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    They must be proud of their site. It helps unqualified people get jobs they can't handle.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 316 through 330 (of 4,080 total)