Forum Replies Created

Viewing 15 posts - 2,176 through 2,190 (of 4,085 total)

  • RE: Importing Multiple .csv files into one database from network shared drive

    I don't see a question here. If you're asking what the best approach to use is, it really depends a lot on what skills you have.

    Personally, I like SSIS,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Split Record by Field into Multiple Records

    Both Mark's and Kevin's solutions use a non-SARGable join. Here is a version where the join is SARGable. It also allows for variable length ranges. If you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query to find all procedures that uses functions in the where clause(left operand)

    ScottPletcher (11/3/2016)


    drew.allen (11/3/2016)


    ScottPletcher (11/3/2016)


    You could try limiting the pattern matching to only the text between "[whitespace-char]WHERE[whitespace-char]" and the next occurrence of "GROUP BY" or "SELECT". Of course that's also...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to trace the effected table when a primary table is updated/inserted

    You should NOT be using SQL Profiler, which has been deprecated. You should be using extended events.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SUM and Group using IN clause

    Assuming that the obvious solution isn't what you were looking for, try the following.

    SELECT

    CID,

    MyCodes,

    SUM(CASE WHEN MyCodes IN ('Full', 'part', 'Contract') THEN Hours END),

    FROM MyClrTbl

    GROUP BY ID, MyCodes

    Although, it looks like...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: update question

    ScottPletcher (11/3/2016)


    I avoid the ISNULL "tricks" when I can in favor of straightforward code:

    UPDATE table_name

    SET Foo = CASE WHEN Foo > '' THEN ', ' ELSE '' END + 'newvalue'

    I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: join two tables on Column where column has value specified more than once

    hegdesuchi (11/3/2016)


    hi ,

    Thank you!

    I used distinct and got the answer.

    I have to stage the data from XML file into different tables and then use joins to put them...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query to find all procedures that uses functions in the where clause(left operand)

    ScottPletcher (11/3/2016)


    You could try limiting the pattern matching to only the text between "[whitespace-char]WHERE[whitespace-char]" and the next occurrence of "GROUP BY" or "SELECT". Of course that's also not perfect,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is my use case a good fit for Unpivot and Pivot ?

    Yes, I forgot to move the ORDER BY clause to the main query when I copied the first query to create the second query.

    There is an extra END in the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is my use case a good fit for Unpivot and Pivot ?

    I think that UNPIVOT/PIVOT is overkill for this particular situation. I was able to get very close to your results using four simple CASE expressions.

    SELECT *

    ,CASE WHEN wtt.Status =...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Is my use case a good fit for Unpivot and Pivot ?

    This looks like actual patient data. If so, it is a serious HIPAA violation. We don't need the name and phone number to solve your issue and it...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Exclude the negative value in OT calculation

    I stated on another thread that the number of different posts for this same query indicate that the OP is purposely fragmenting the discussion to hide the complexity of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding Product into cart using SP

    The problem is here:

    Insert Into Product (CustomerID, ProductId, OrderID, Quantity, Date1)

    SELECT @CustomerID, @ProductId, @OrderID, 1, GETDATE()

    From Product Where ProductId = @ProductId And CustomerID = @CustomerID AND OrderID <> @OrderID

    UNION

    SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Total by Group.

    Given the numerous threads the OP has started on what appears to be the same exact query, I think that this task is simply too complex to be handled in...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using SQL Server Profiler 2012 with SQL 2014

    Have you looked at using extended events? Profiler has been deprecated for running traces. (Although, you didn't specify that you were running a trace.)

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,176 through 2,190 (of 4,085 total)