Forum Replies Created

Viewing 15 posts - 3,541 through 3,555 (of 4,085 total)

  • RE: Creating a function to replace symbols with HTML names

    I was able to get it to work with the following:

    SELECT @Text = Replace(@Text COLLATE LATIN1_GENERAL_BIN, Symbol, HTML)

    FROM @Symbols

    WHERE PatIndex('%' + Symbol + '%', @Text) > 0

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Table joins to return non repeating values

    toddasd (10/18/2011)


    Nice solution, Drew. Very smooth.

    OP, if you want the extra non-matches to not show, thrown a WHERE n.Name IS NOT NULL

    AND s.Code IS NOT NULL; to the end...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Creating a function to replace symbols with HTML names

    This is actually much simpler than it seems, because SELECT is implemented behind the scenes as a loop. Jeff Moden refers to this as a pseudo-cursor. You can...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Table joins to return non repeating values

    This is actually quite easy. You need to order each of the tables separately and then join the two tables both on the segmentID and the order. I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Finding the column containing the minimum value

    irobertson (10/18/2011)


    So, I still don't beat the case statement. But I had fun, so that's all that matters 🙂

    Actually, the CASE version isn't even completely optimized. It's doing a...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to only return one row per key with a LEFT JOIN

    You have two options. Which one works best will depend on a number of factors such as what indexes you have/create and how selective those indexes are.

    Option 1: CTE...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Cummulative percents

    Jeff Moden has a very good article on exactly this type of problem.

    Solving the Running Total and Ordinal Rank Problems (Rewritten)[/url]

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: This query keep on executing , not ending

    DELETEs are fully logged, and you're trying to delete 10 million rows IN ONE TRANSACTION. You need to break this up into more manageable pieces. You can use...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Create table columns from table rows

    The most efficient way to do this is to use the correct tool for the job. That tool is a reporting tool (such as SSRS). T-SQL is most...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Dynamic Color Expressions in Calculated Members

    This is a presentation issue, and is best done in the presentation layer. You don't mention what you are using for your presentation layer, so we can't give you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Covert style 120 vs 102

    vick12 (10/13/2011)


    The format of my procedure is as follow: if not converting to varchar in orderby then I ma getting error in ssrs 2005

    create stored procedure testsorting

    ( @sort varchar(60)

    )

    as

    BEGIN

    SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Finding "Max" Value from subquery

    Lynn Pettis (10/13/2011)


    Post your code? You may find this solution works better. Always worth investigating.

    I didn't save the code.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Regarding SQL Query optimization

    Junglee_George (10/13/2011)


    Which one of the following is preferred considering the performance of the SQL query executed..??

    Actually, neither one is preferred. The first one is worst--as has already been mentioned--because...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Summarize Results from two tables, using one query.

    You have to be careful with the joins, if either of the tables has a one-to-many relationship. You could potentially be double-counting some of the records I would use...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: help with datediff for hours

    memostone86 (10/11/2011)


    Thank you so much Toddasd, it works great

    Actually, it doesn't work correctly. It assumes that there is only one change in the power status for each VM in...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,541 through 3,555 (of 4,085 total)