Forum Replies Created

Viewing 15 posts - 3,841 through 3,855 (of 4,085 total)

  • RE: Building multiple CSV columns - Need Alternative to FOR XML PATH

    SSSolice (10/11/2010)


    I use the following to build a csv column from table "A" (one) and table "B" (to many). It works fine but is very slow exspecially when building multiple...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SET results from a SELECT....FOR XML EXPLICIT to a variable

    I put the UNION within a CTE and then used SELECT @var = expression instead of SET, because it appears that you can't use a CTE with SET.

    DECLARE @CurrencyRateHistoric...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SET results from a SELECT....FOR XML EXPLICIT to a variable

    It would help if you had posted the code where you tried to assign the variable and the error that you received. It also helps if you post DDL...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Simple query

    You're trying to insert new rows when you should be updating existing rows.

    UPDATE A

    SET B = B + ' Large', C = C + ' Large'

    WHERE A LIKE '%LG'

    I assume...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Changing Column Names from a lookup table

    Assuming that your dispLookup table changes relatively infrequently, it might be best to create a trigger on dispLookup to dynamically create/alter a view with the user-friendly column names. This...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Sql Query output in excel format

    You can save a grid as CSV or you can select the entire grid and paste it into Excel. There is a setting in options that will copy the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Design approaches to improving a slow query

    I agree with Bhuvnesh that your join on B3 and B2 is probably what is causing the problem. (Of course this would be easier to test with sample data.)...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Mass Update\Replace within Transaction

    Lowell (10/1/2010)


    update mytable

    set myfield= replace(myfield,'oldtext','newtext')

    WHERE mytable.myfield NOT LIKE '%somestring that appears in newtext%'

    It's better to use

    update...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: concatenating CASE stmt results

    Jeff Moden (9/30/2010)


    Exactly. Do the same thing with a variable and it changes the Simple to a Searched CASE in the scalar operator. I haven't tested it but...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update statement error

    laddu4700 (9/30/2010)


    Table2 name is StatusReason

    The foreign key should be referencing Status, not StatusReason.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update statement error

    Your FOREIGN KEY is referencing a table called Table2. You probably need to change it to reference the Status table.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update statement error

    A FOREIGN KEY constraint specifies that the value(s) for some column(s) must uniquely identify one row in the referenced table. You have a foreign key constraint "IUser1" on your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CONCATINATE COLUMNS

    Lynn Pettis (9/29/2010)


    Remove the comma leaving the space and change the STUFF parameters 1,2 to 1,1 and see what happens.

    Actually, if you remove the comma, you can remove the STUFF...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query Rewrite

    WayneS (9/29/2010)


    touchmeknot (9/29/2010)


    Shawn, This might sound silly. how do you paste the code like that, as in I see a separate box there 🙂 ?

    When you're working in the editor,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Procedure not executing in trigger

    pankaj.kuchaliya (9/22/2010)


    when the trigger is fire then it display the "The transaction ended in the trigger. The batch has been aborted".

    Please help me.

    Everything within a trigger--including calls to stored procs...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,841 through 3,855 (of 4,085 total)