Forum Replies Created

Viewing 15 posts - 8,416 through 8,430 (of 15,381 total)

  • RE: Find Orphan records in a table

    You could use a recursive cte for this.

    btw, in your sample data you have no orphans because UnitID 631 is the first one there. 😉

  • RE: Creating a hierarchy group from one table column containing both parent and child hierarchy info

    azdeji (5/8/2013)


    Wanted results something like below -

    INSERT INTO Wanted results (Participant_ID,supporter_id,event_code,Event_role,Lv2 child,Lv3 child) VALUES ('234221','98130','BALL05','NULL','Do not register','Did Not Attend');

    INSERT INTO Wanted results (Participant_ID,supporter_id,event_code,Event_role,Lv2 child,Lv3 child) VALUES ('234222','98130','BCC07','NULL','No Reg','Did Not Attend');

    INSERT...

  • RE: Creating a hierarchy group from one table column containing both parent and child hierarchy info

    Great job posting ddl and sample data. What do you want as output?

  • RE: How do I retrieve a value in a text column that has a XML

    Or since your XML appears to not really be xml maybe you need to query this as text.

    if OBJECT_ID('tempdb..#XMLish') is not null

    drop table #XMLish

    create table #XMLish

    (

    Messaging text

    )

    insert #XMLish

    select '<?xml version="1.0"...

  • RE: Join creating two records

    dwilliscp (5/8/2013)


    Lynn Pettis (5/8/2013)


    dwilliscp (5/8/2013)


    ...

    I have found one other strange thing..

    The outer join has data in the columns for details_2, so I do not understand how in the heck it...

  • RE: CROSS APPLY Question

    It is nearly impossible to offer much assistance because we don't have any details to work with. At the very least we would need to see actual execution plan. ddl...

  • RE: stored procedure troubles

    Eugene Elutin (5/8/2013)


    elmoustabchir (5/8/2013)


    thank you

    for my first error , its a column like this : déc 5 2007 12:00AM ( i dont understand why it doesnt work because its...

  • RE: Queries for Multiple Databases

    Here is one way to do this without a cursor. It has the additional advantage of putting all the results into a single table instead of 1 table for each...

  • RE: Join creating two records

    What are the results of these two queries?

    select COUNT(*) FROM #Delivery Where cast(delivery as int) = 83535308

    select COUNT(*) from details_2 where cast(details_2.Delivery_Doc as int) = 83535308

  • RE: Join creating two records

    dwilliscp (5/8/2013)


    Since the first table had one record with a delivery of 00835308 and the second had none, I would have expected the SQL to return one record. What I...

  • RE: stored procedure troubles

    elmoustabchir (5/8/2013)


    thank you

    for my first error , its a column like this : déc 5 2007 12:00AM ( i dont understand why it doesnt work because its pretty simple...

  • RE: need Top 1 record

    prakashr.r7 (5/8/2013)


    Hi Friends,

    I have some rows where all the fields are very much similar to each other except ...

  • RE: stored procedure troubles

    elmoustabchir (5/8/2013)


    Hello

    its my first topic hope i'll get a solution for my troubles

    i have some stored procedure and every things its okay when i execute my SP except them...

  • RE: Alter schema statement - Incorrect syntax near '\'.

    Kbear (5/7/2013)


    I am trying to use the alter schema statement on a table with this name:

    ABC\genn.smith.itemresults

    with this statement

    ALTER SCHEMA dbo TRANSFER ABC\genn.smith.itemresults

    and I get this error:

    Incorrect syntax near '\'.

    What does...

  • RE: Inner join returning all rows.

    TryingToLearn (5/7/2013)


    really appreciate your help. This code was written 10 years ago....and i am a little new to coding.

    SELECT DATEADD(mm, DATEDIFF(mm, 0, CONVERT(DATETIME, '20121130', 112)), 0) MonthStart ) CM

    ON calldate...

Viewing 15 posts - 8,416 through 8,430 (of 15,381 total)