Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)

  • RE: EMPTYFILE

    The Microsoft article uses a strangely anthropomorphic explanation, "Emptyfile assures you that no new data will be added to the file".  I'm happy to take DBCC's assurances any day but...

  • RE: Formatted ASCII Results from a SELECT

    Hello Bevan,

    In my haste I didn't try a null date, but you're right of course. Converting to varchar first means that no date or other type is presented to...

  • RE: Formatted ASCII Results from a SELECT

    Thanks Bevan and John for the explanation. 

    I had a chance to use it in a real scenario today but I hit a snag with Null values.     ...

  • RE: Formatted ASCII Results from a SELECT

    That's a brilliant idea.  I often want to paste a small set of data into an email and it takes effort to make it readable even with SSMS's text output. ...

  • RE: A Single-Parameter Date Range in SQL Server Reporting Services

    Excellent article - this technique is invaluable, especially for scheduling reports with varying periods.

    Uncannily, after a long time thinking "there must be a better way to choose dates", I sat...

  • RE: Using a column name in a COUNT function

    I have tried it now and you're right, Count(*) and Count(1) behave the same on version 2008 R2 (RTM) - 10.50.1600.1 (X64). I misread the QotD text.

  • RE: Not Again!

    ..

  • RE: Not Again!

    Could this be a reason for preferring Count(1) over Count(*) - which is otherwise not an easy decision.

    Edit: No indeed, I misread the question.

  • RE: Using a column name in a COUNT function

    Does the Question of the Day of 2015-02-18 have a bearing on this discussion?

    That is, COUNT(1) is the more reliable option because COUNT(*) will fail if the user is denied...

  • RE: Using a column name in a COUNT function

    Did anyone mention that variables are also accepted by COUNT()?

    DECLARE @i int

    SELECT COUNT(@i) FROM [CountTest]

    -- returns 0

    DECLARE @i int = 1

    SELECT...

  • RE: How Many Different Random Numbers?

    Thanks Sean, the penny has dropped now.

  • RE: How Many Different Random Numbers?

    Todd Reddinger (9/30/2014)


    the ORDER BY in the OVER clause orders the records returned by the select. By adding an order by on the select, a differect set of records is...

  • RE: How Many Different Random Numbers?

    The mistake in the question was overlooking the fact that sys.syscolumns will have different contents in different databases.

    But more than that, you couldn't guarantee the statement would return the same...

  • RE: How Many Different Random Numbers?

    At least following the recent spate of RAND() questions I found it quicker to spot that the question had gone wrong. I'm beginning to feel I finally know...

  • RE: RAND Unions

    TomThomson (9/29/2014)


    SQLRNNR (9/29/2014)


    andrew.ing (9/29/2014)


    Something I've never quite understood is why RAND() is like it is - that is, contrary to what perhaps most people would want and expect: creating a...

Viewing 15 posts - 1 through 15 (of 19 total)