Forum Replies Created

Viewing 15 posts - 18,331 through 18,345 (of 26,489 total)

  • RE: T-SQL

    I see that the question has been rewritten as it is now using variables that are set first and changes the word same to equivalent.

    Now that the question has been...

  • RE: T-SQL

    christian.ain (11/17/2009)


    I agree with all of you, most of us in the planet have to reply False since GETDATE() and GETUTCDATE() don't return the same value, except if you are...

  • RE: T-SQL

    Was this, assuming they all complete within the same second, always there? I don't even remember seeing it.

  • RE: T-SQL

    david.wright-948385 (11/17/2009)


    Just wondering... did you write the QOD Lynn?

    Nope, but I got the answer right without reading the discussion or running the code. I guess the force was strong...

  • RE: T-SQL

    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 every row...

  • RE: T-SQL

    Okay, I think I have my answer. In the first query, using the Tally table to generate a batch of 10,000 entries, the scalar function IS called once. ...

  • RE: T-SQL

    Back to the code posted earlier. Anyone have an explanation as to why one may generate a small number of values that are differnet and the other doesn't?

    I guess...

  • RE: T-SQL

    Tom Garth (11/17/2009)


    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...

  • RE: T-SQL

    Okay, I have just run some more tests.

    If I generate the test values using GO 10000 to load a table I can get it to fail about 9 times out...

  • RE: T-SQL

    Well then, parallelism must be working on my system here because I have run this 10,000 times and don't have a discrepancy between them. System here has dual quad...

  • RE: T-SQL

    This:

    WHILE 1 = 1

    BEGIN

    IF GETDATE() = GETDATE() BEGIN

    ...

  • RE: T-SQL

    Tom Garth (11/17/2009)


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

    Take a look at this:

    ...

    Your correct GETDATE() <> GETUTCDATE(), but GETDATE() and GETUTCDATE() can represent...

  • RE: T-SQL

    Because, I can also write the queries like this:

    SELECT

    DATEADD(day, -1, GETDATE()),DATENAME (dw ,DATEADD(day, -1, GETDATE()) ),

    GETDATE() - 1, DATENAME (dw ,GETDATE() -...

  • RE: T-SQL

    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 getutcdate() in...

  • RE: T-SQL

    I GOT it!

    The query should have been written like this instead of as four separate queries:

    SELECT

    DATEADD(day, -1, GETDATE()),DATENAME (dw ,DATEADD(day, -1, GETDATE()) ),

    ...

Viewing 15 posts - 18,331 through 18,345 (of 26,489 total)