Forum Replies Created

Viewing 15 posts - 1 through 15 (of 186 total)

  • Reply To: SQL XML help

    Thank you! That worked.

  • Reply To: SQL XML help

    I was playing around and I got the first part

    SELECT

    top 2 'class1' as [@ClassName]

    ,AccountNumber as 'ExternalId' from Account

    FOR XML PATH('Element'),type

    --generates output

    <Element ClassName="class1">

    <ExternalId>3002543105</ExternalId>

    </Element>

    <Element ClassName="class1">

    <ExternalId>3002651195</ExternalId>

    </Element>

     

    But not sure how I add "TYPE" in...

  • Reply To: SQL XML help

    The data is just simple I have a table named  Account  that stores the account number

     

    Table : Account

    3002543105

    3002543106


     

     

  • Reply To: Delete from parent table question

    I want to keep the child data but just clear out the parent  table.

  • Reply To: update query help

    The data type is int for all columns . yes order by col1. Also there can be consecutive null values. But all the consecutive null values will be updated to...

    • This reply was modified 5 years, 3 months ago by  Guras.
    • This reply was modified 5 years, 3 months ago by  Guras.
  • Reply To: Delete is very slow

    Yes, the indexing on the FOREIGN  KEY on the referencing tables did it. Thank you !

  • Reply To: Delete is very slow

    Thank you  I will try this.

  • Reply To: Delete is very slow

    It has scan  to find the 1000 rows

    code for the view

    select top 200 key1 from [dbo].[Mytable1]

    where key1 not in (select key1 from Mytable2)

    order by Key1

     

    --I was not ordering before still...

  • Reply To: Delete is very slow

    Y.B. wrote:

    Guras wrote:

    No, I am the only one running this query at the moment.

    That doesn't mean there can't be another process locking your table.

     

    No processes nothing. I am the...

  • Reply To: Delete is very slow

    No, I am the only one running this query at the moment.

  • RE: Extended Events to capture deadlocks

    Sue_H - Tuesday, February 26, 2019 11:42 AM

    Guras - Tuesday, February 26, 2019 7:09 AM

  • RE: Date update

    DOUCETTR26 - Tuesday, February 26, 2019 1:15 AM

    I am trying to use the SQL below

  • RE: String split help

    gilbert delarosa - Wednesday, November 28, 2018 10:08 AM

    There's also this tally table approach if the col3 source can be longer...

  • RE: String split help

    Jonathan AC Roberts - Wednesday, November 28, 2018 9:35 AM

    ;WITH myTable AS
    (
        SELECT *
          FROM (VALUES...

  • RE: Error handling in nested stored procedure

    sgmunson - Wednesday, July 11, 2018 3:23 PM

    Guras - Wednesday, July 11, 2018 3:09 PM

Viewing 15 posts - 1 through 15 (of 186 total)