Home Forums SQL Server 2008 SQL Server Newbies Update query for my new boss in my new job I am struggling with RE: Update query for my new boss in my new job I am struggling with

  • ChrisM@Work (2/22/2013)


    I'm not so sure either - the tables might look like this:

    DROP TABLE #Table1

    SELECT

    *

    INTO #Table1

    FROM (

    SELECT Column1 = 'microsoft outlook 2007,microsoft 2007 outlook,microsoft out look 2007,microsoft 2007 office,microsoft office 2007'

    ) d

    DROP TABLE #Table2

    SELECT

    *

    INTO #Table2

    FROM (

    SELECT

    Column1 = 'microsoft outlook 2007,microsoft 2007 outlook,microsoft out look 2007,microsoft 2007 office,microsoft office 2007',

    Column2 = 'outlook 2007,office 2007'

    ) d

    SELECT * FROM #Table1

    SELECT * FROM #Table2

    in which case it's changed from a trivial exercise to an interesting one 😉

    As tempting as this is, I won't jump on this challenge until we here back from the OP! 😛


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St