Forum Replies Created

Viewing 15 posts - 106 through 120 (of 322 total)

  • RE: Variables, Nulls and Coalesce

    The 2nd SELECT has no ORDER BY clause, and the table variable has no index. How do you know what the last row will contain?

    😛

  • RE: Introduction to Indexes: Part 3 – The nonclustered index

    Thanks Gail,

    Well written. I read all 3 and learned a few things.

  • RE: T-SQL

    Steve Jones - Editor (11/17/2009)


    I have awarded back all points to people as of now. Apologies for the delay, but this was not the high priority of the day.

    The question...

  • RE: T-SQL

    CirquedeSQLeil (11/17/2009)

    "Will all these statements when executed as a batch return an equivalent date, hour, minute and second assuming they all complete within the same second?"

    Ah, but you got the...

  • RE: T-SQL

    Lynn Pettis (11/17/2009)


    Okay, nope, it is called twice. Once for each column. Changed the Tally version to generate 100,000 records. Guess what, Date1 was the same for...

  • RE: T-SQL

    Yes. I think that typical system clock resolution is 0.060 seconds. In spite of CPU speed, the clock doesn't register every millisecond.

    cengland0 (11/17/2009)


    I clicked 'Quote' a couple of times and...

  • RE: T-SQL

    You TallyHo you.

    It doesn't really apply to the QoD. I only followed that path because I was curious, and now I know. Will it ever come in handy to know...

  • RE: T-SQL

    Lynn Pettis (11/17/2009)


    This:

    (something funky here at work, I had to remove the DECLARE and PRINT statements to get this post to post)

    I agree. I clicked 'Quote' a couple of times...

  • RE: T-SQL

    Lynn Pettis (11/17/2009)


    I really missed something else, but learned something as well just now.

    1) Multiple calls to getdate() in the same query will return the same value.

    2) Multiple calls to...

  • RE: T-SQL

    As it happens, SQL Server does not recognize GetDate() and GetUtcDate() as being equal.

    Take a look at this:

    IF GETDATE() = GETUTCDATE()

    SELECT 'TRUE'

    ELSE

    ...

  • RE: T-SQL

    Well technically its NOT TRUE, since the real answer is SOMETIMES. That isn't an option, so FALSE would be the logical choice.

    This question is kind confusing because of the wording,...

  • RE: REPLACE Multiple Spaces with One

    bornsql (11/16/2009)


    Hi how about this code whether this will work fine or not

    DECLARE @tmpstr2 Varchar(MAX)

    SELECT @tmpstr2=replace(OriginalString, char(10) + char(13), '') FROM @demo

    SELECT @tmpstr2=replace(@tmpstr2,' ','|')

    SELECT @tmpstr2=replace(@tmpstr2,'|','')

    SELECT @tmpstr2

    In the end this..

    The goal...

  • RE: REPLACE Multiple Spaces with One

    How very elegant, and cool. It's so well explained that I know I'll remember it the next time I have to do some cleanup.

    Thanks Jeff!

  • RE: Solving the "Running Total" & "Ordinal Rank" Problems (Rewritten)

    Regarding my temp table without ORDER BY observation:

    It was just that. An obversation.

    I didn't say that I don't use ORDER BY.

    I didn't recommend not using ORDER BY.

    I was hoping...

  • RE: Solving the "Running Total" & "Ordinal Rank" Problems (Rewritten)

    Jeff,

    Terrific article. I haven't used Quirky Update for a few years, and that's a good thing because I didn't know all of the rules.

    I don't want to stir up a...

Viewing 15 posts - 106 through 120 (of 322 total)