Forum Replies Created

Viewing 15 posts - 601 through 615 (of 4,085 total)

  • RE: Joining a result set to a base table

    jonathan.crawford - Friday, March 15, 2019 4:02 PM

    drew.allen - Friday, March 15, 2019 3:25 PM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Loading Data from Staging Table to Parent and child tables

    pdsqsql - Friday, March 15, 2019 3:45 PM

    Thanks but not sure about OUTPUT clause,  I will google it but if you have...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Loading Data from Staging Table to Parent and child tables

    You're thinking procedurally instead of set-based.  The tables load all at once, not one row at a time.  Look at the OUTPUT clause and study those examples.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Joining a result set to a base table

    shel 29143 - Friday, March 15, 2019 12:35 PM

    I have a weird one that is hard to explain.
    So I am looking for...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: select by "pattern"

    This gives the results you want.  I had to add a little extra code to treat 1 the same as zero.


    WITH eventgroups AS
    (
        SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using recursive CTE

    You're also confused about the meaning of recursion.  Recursion is when one CTE refers to itself, not when one query references another.  Even if you use a CTE, I see...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to return a value if an INNER JOIN isn't satisfied?

    chocthree - Friday, March 15, 2019 10:18 AM

    Hi Jonathan,
    Using a FULL JOIN in place of an INNER JOIN returns the below dataset:

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Parse XML Data

    handkot - Wednesday, March 13, 2019 7:30 AM

    maybe this will help

    declare @xml as xml = '
    <Data>
     <Interventions_x0020_Provided>
      <Interventions_x0020_Provided_x0020_SubTable>
       <Intervention>On-site (Observations, Consultation)</Intervention>
       <Provided>true</Provided>
       <Minutes>35</Minutes>
       <Describe>Completed observation. Discussed...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Merge Statement Issue

    It's exactly what it says.  There are two matches for itemid = 1, so it doesn't know which record to use in the merge.  Given your desired result, you'll want...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Union with co-related subquery

    Jonathan AC Roberts - Tuesday, March 12, 2019 5:04 AM

    SELECT FirstName, SecondName, T.MaxPayDate Pay_Date
      FROM Employee e
     CROSS APPLY(SELECT TOP(1) Pay_Date
     ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Create View Declar Variable question

    A view can only consist of a single SELECT statement.  You cannot create tables, declare, open, close, deallocate, or fetch from cursors, execute dynamic sql, or declare variables.  You may...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Combine multiple nvarchar columns into string

    The purpose of the STUFF() is to remove the very first delimiter when creating delimited strings.  You're not delimiting your strings, so you do not need the STUFF().

    If...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Selecting different columns of joined tables based on certain criteria

    Here is another option.  This approach probably becomes more attractive as you add more columns to the conditions.

    SELECT c.column1, c.column2
        FROM table1 a

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Issue updating columns for existing rows

    There are three options I would suggest.  The first two might not be possible if you have constraints on modifying or creating tables.

    1)  Add a computed column that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Performance Issue

    There's not much to say, since you haven't
    a) included your query
    b) included the actual execution plan.

    It would also help to include table definitions and any views/functions...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 601 through 615 (of 4,085 total)