Forum Replies Created

Viewing 15 posts - 2,596 through 2,610 (of 4,086 total)

  • RE: Filtering out characters with substring

    It's essentially an XML fragment. Why don't you treat it as such?

    DECLARE @String varchar(512) ='<iframe src="http://player.vimeo.com/video/3782iiii?title=0&byline=0&portrait=0&autoplay=1" width="704" height="396" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'

    SELECT CAST(REPLACE(REPLACE(@String, '&', '&'), 'AllowFullScreen', 'AllowFullScreen="true"')...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Database design question

    Why don't you add the UPC code to the database and use that to link the various records together?

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Beginning a CTE

    Terje Hermanseter (6/3/2016)


    I always use them and encourage others to do the same.

    I've been too sloppy. I need to be more consistent and start to use them even when I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Create or update rows on the basis of time interval

    arihantjain121189 (6/2/2016)


    It is not the pivoted table.. Its a table with attributes stored in columns and in the input i can get any attribute to update data into the final...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: difficult group question

    There are actually several different approaches you can use. Here are two:

    ; -- Use a table value constructor with the ranges

    WITH sample_data AS (

    SELECT *

    FROM (

    VALUES

    (11, 1)

    ,(12, 1)

    ,(13, 2)

    ,(14,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Filtering within a group or figuring out how to loop through results

    You should test the code for your sample data before posting it. When I ran the code, I got an error, because the Start_Date is set to NOT NULL,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Create or update rows on the basis of time interval

    Your FinalResult table looks like it's the result of a pivot or crosstab. It would be easier to make the updates before the pivot/crosstab rather than after the fact....

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Syntax help needed for UPDATE Statement

    mw112009 (6/2/2016)


    Good,

    I was also asked to use the LTRIM(RTRIM( around the fields so that there be no spaces around. How can we handle that ?

    [rant on]

    If you don't...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Syntax help needed for UPDATE Statement

    I actually prefer to use the XML concatenation method, which also automatically handles NULL values, and--unlike CONCAT--works in SQL2008, and is easier to check that you're getting the correct values.

    Update...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Create or update values on the basis of time intervals

    Please don't cross post. It fragments the replies. Please respond to http://www.sqlservercentral.com/Forums/Topic1791754-3077-1.aspx

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need help in t-sql query

    However, there are problems when the data is even a little more complex. For instance, a person might switch from one email to another and then switch back to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Looking for a way to find a process/trigger/whatever that is removing entries from a table

    Using SQL Profiler for traces has been deprecated. You should start using Extended Events.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SELECT from Many-to-Many Columns Unique Values from Column 1 and Non-duplicate from Column2

    yb751 (6/1/2016)


    Ok so after a few voodoo spells and a couple chickens later I came up with this. If it looks weird, that's because it is. I'm pretty...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Performance / Query Tuning Question Regarding Missing Indices

    To answer your question, equality columns are columns that generally appear in JOIN/WHERE clauses with an equal sign; inequality columns generally appear with some inequality, e.g., <=. Equality columns...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need help on query performance

    jc85 (6/1/2016)


    Sergiy (6/1/2016)


    Now you're gonna hit your head again asking "why did not i think of it?".

    It's so easy. 🙂

    You group you'd events by day:

    dateadd(dd,0, datediff(dd,0,b.start_time)) as [date]

    But what you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,596 through 2,610 (of 4,086 total)