Forum Replies Created

Viewing 15 posts - 4,561 through 4,575 (of 6,486 total)

  • RE: Ways to deal with NULLS.

    Andrew (2/25/2008)


    ACTUALLY I was hoping to get a poll of what people are actually doing to mitigate NULLs - how do I do that?

    I am happy to discuss NULL as...

  • RE: Bit Data Types

    The "problem" with the SUM is that it's going to preserve the datatype, so you end up with some really "strange" results. Such as - anything summing up even...

  • RE: Not sure of best way to select different status values

    I'm forcing the like to compare something that looks like this (the @statuscodes)

    |2|3|4|12|15|

    to this (what I'm doing to status)

    |1|

    Now - I'm forcing the | on either side of the status...

  • RE: count problem

    Select user,

    datepart(yyyy,datein)*100+datepart(mm,datein) as yearmonth,

    count(datein) as LoginCount

    from login

    WHERE

    ...

  • RE: Help required on counting functions in SQL

    Use a "conditional count" to do that. Looks something like this (one of several methods - but this is the one I use)

    select count(*) as TotalCount,

    ...

  • RE: Ways to deal with NULLS.

    Andrew (2/25/2008)


    Consider a simple table with columns NAME, AGE.

    Row 1 = "Fred", 50

    Row 2 = "Jane", NULL

    Now formulate SQL to answer the questions

    "How many people are under 3 years...

  • RE: count problem

    Are you trying to get a count by month by user? or do you just want a count by user for the period?

  • RE: Importing Negative numbers in BCP is different from DTS

    My experience leads me to believe that it is almost never a good idea to perform ANY transformation of the incoming data during the initial load phase. Pretty much...

  • RE: Not Connected

    I guess my voice on this is - it's so discouraging to use that I don't use it. I too have found that it seems structured specifically to put...

  • RE: Not sure of best way to select different status values

    LIKE applies to text/char-based columns. If your status field is numeric, then you would need to CAST it to a varchar(20) (making the width appropriate to your data).

    So:

    Declare @StatusCodes...

  • RE: Ways to deal with NULLS.

    Andrew (2/25/2008)


    In the real-world the possible answers to a truth question T might indeed not be just "yes" or "no" but might be, say, one of "Yes", "No", "Don't Know...

  • RE: Ways to deal with NULLS.

    By the way - I'd like to post a "null" value to your poll - no answer really applies to my scenario (or rather fully represents my situation).

  • RE: BEGIN and END in stored procedure

    Google is a powerful powerful thing......:cool: ( I had forgotten what the P was for...:D)

  • RE: Ways to deal with NULLS.

    As much as I'd like to say that the positions espoused by our friends CJ Date and Fabian Pascal are wonderful and true, and that NULL should be banished into...

  • RE: BEGIN and END in stored procedure

    Jeff Moden (2/25/2008)


    I know of no advantage... I did a test once on a 10 million row table where it seemed to run a couple ms faster without BEGIN/END... but...

Viewing 15 posts - 4,561 through 4,575 (of 6,486 total)