Forum Replies Created

Viewing 15 posts - 3,361 through 3,375 (of 4,085 total)

  • RE: Returning a column per date in a range

    SQL Kiwi (1/12/2012)


    drew.allen (1/12/2012)


    ...the OP doesn't have ANY code in place and is looking for the best solution...

    The thread starter was not Bob Cullen (the chap playing around with an...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Returning a column per date in a range

    SQL Kiwi (1/12/2012)


    Jeff and Chris,

    You've missed the point I was making, and have chosen to assume that I am either (a) not aware of the performance issues involved; or (b)...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: if 2nd year and same Programme for same Student, then return no results

    drew.allen (1/11/2012)


    I think it's actually even simpler.

    SQL Kiwi (1/11/2012)


    That has a different semantic though. Example:

    That's true, but this statement from the original poster sounds like the GROUP BY is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SQL Server equivalent to DB2 HEX

    SQL Kiwi (1/11/2012)


    Greg Snidow (1/11/2012)


    The 'B' shows up no matter what I put in for the length parameter of CHAR. I still don't know what it means.

    So 'B' is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: if 2nd year and same Programme for same Student, then return no results

    I think it's actually even simpler.

    SELECT StudentID, Programme, Min([Year]) AS [Year]

    FROM #Students

    GROUP BY StudentID, Programme

    HAVING Min([Year]) = 2009

    You may not even need the HAVING clause depending on what you are...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Returning a column per date in a range

    SQL Kiwi (1/11/2012)


    You might have missed that I quoted the performance impact directly from the article "(150ms from Jeff's article graph)", which is one I have read many times (see...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Returning a column per date in a range

    SQL Kiwi (1/11/2012)


    drew.allen (1/11/2012)


    Bob Cullen-434885 (1/10/2012)


    I started to look at an alternative approach, using a recursive CTE to generate a continuous list of dates that covered the report range

    Jeff Moden...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Returning a column per date in a range

    Bob Cullen-434885 (1/10/2012)


    I started to look at an alternative approach, using a recursive CTE to generate a continuous list of dates that covered the report range

    Jeff Moden has an article...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need to audit update without cursor

    GSquared (1/9/2012)


    Audit logging doesn't need to use the "inserted" data. You already have that in the table you just updated. Logging it just increases the size of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to do bitwise operation between strings? Thanks.

    halifaxdal (1/9/2012)


    Each digit represents a record in another table, let me explain here so you can see if my design is good, your suggestion could be better though:

    Table 1: has...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need to audit update without cursor

    This is sometimes done using a trigger, but you may not have rights to create a trigger on the table being updated. Another option is to use the OUTPUT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update with except conditon

    ChrisM@home (1/5/2012)


    You've lost me Drew - I understand that the query I posted is incorrect, but how does the (theoretical) sample data I posted violate normalization?

    I didn't notice that you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to insert multiple rows into a table with identity column

    CELKO (1/5/2012)


    But IDENTITY is a sequential count of insertion attempts. PHYSICAL insertion attempts. Not a LOGICAL concept at all. So how do you number these rows?

    You're confusing what IDENTITY is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Row to column

    You can use UNPIVOT, but that gets very messy when you're trying to unpivot into more than one column. You would need three.

    You can also use CROSS APPLY to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update with except conditon

    ChrisM@home (1/5/2012)


    drew.allen (1/4/2012)


    ChrisM@home (1/4/2012)


    say there are ten rows with the same VND_ID and only one of them matches the filter?

    You'll need to post sample data illustrating the problem and the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,361 through 3,375 (of 4,085 total)