Forum Replies Created

Viewing 15 posts - 1,471 through 1,485 (of 3,348 total)

  • RE: Phantoms and isolation

    PHYData DBA (8/18/2014)


    Or you could just do lots of testing to make sure using NOLOCK is not affecting your queries results adversely and move on.

    Why waste time, money,...

  • RE: Phantoms and isolation

    Raghavendra Mudugal (8/18/2014)


    say we use nolock and it reads dirty and executes the select statement faster, now how to achieve the same speed without using nolock?

    That's the wrong question to...

  • RE: Implicit transaction mode

    It's been like that for a long time already. In some places, the QotD author is presented with the correct author. In other places, it is presented with the author...

  • RE: In-line variable assignment 2

    Thanks, all, for the nice words! 😉

    Sektor / Iulian: Yes, this is indeed different from C#, which (as far as I know - probably not very far) uses multiple-pass compilation....

  • RE: In-line variable assignment 1

    TomThomson (8/6/2014)


    Hugo Kornelis (8/5/2014)


    I see that Tom already posted an explanation. I think he is correct, but I will phrase it simpler - my explanation is that a variable is...

  • RE: In-line variable assignment 1

    And to conclude my rapidfire of messages - thanks all for the kind messages.

    This question was indeed easier than some of my others. My goal with this question (and the...

  • RE: In-line variable assignment 1

    Carlo Romagnano (8/5/2014)


    A little variation:

    -- this runs

    DECLARE @i int = 1, @j-2 int = 2;

    SET @i += 2;

    SELECT @j-2 * @i

    GO

    -- this raises error

    DECLARE @i int = 1, @j-2 int...

  • RE: In-line variable assignment 1

    TomThomson (8/5/2014)


    edit: I'm amazed how many people fell for one of the two "only simple values, no expressions" options; and that only 44% got it right.

    I am not surprised by...

  • RE: In-line variable assignment 1

    Raghavendra Mudugal (8/5/2014)


    I executed the script in 2008R2, and I re-read the question and see there is no R2, but still went with the gut feeling that this must work,...

  • RE: In-line variable assignment 1

    Koen Verbeeck (8/5/2014)


    Nice question Hugo.

    Your explanation left out "compound assignment operator" however 🙂

    http://technet.microsoft.com/en-us/library/ms189484(v=sql.100).aspx

    Thans for the addition, Koen!

    I only realise now (after reading your message and another on the same topic)...

  • RE: table variable declaration inside a loop

    patrickmcginnis59 10839 (7/30/2014)


    Some interpreters start executing immediately, I'm hazarding a guess that SQL Server doesn't!

    Correct. SQL Server will parse and compile the entire batch (and the compiling part includes generating...

  • RE: table variable declaration inside a loop

    Brian.Klinect (7/30/2014)


    If you're allowed to re-declare @j-2 inside the while loop, why are you allowed to select from @j-2 outside of the while loop?

    See my post above (which I started...

  • RE: table variable declaration inside a loop

    Mighty (7/30/2014)


    Stewart "Arturius" Campbell (7/30/2014)


    All variables are declared at compile time. at this time, all control flow commands are ignored.

    That is more or less what I was thinking, but in...

  • RE: BCP results

    Roland C (7/27/2014)


    I am sorry, but I don't agree 🙂

    I executed the script in SSMS (SQL Server 2012). It returned "10 row(s) affected", the csv file was created, but was...

  • RE: BCP results

    I realized that #Employee would not be available in the context of the bcp command, but had to do some digging to predict whether that would result in an empty...

Viewing 15 posts - 1,471 through 1,485 (of 3,348 total)