Forum Replies Created

Viewing 15 posts - 4,936 through 4,950 (of 8,761 total)

  • RE: SQL Syntax help for a DELETE statement

    mw112009 (7/13/2015)


    create table abc( lab_id varchar(10), lab_time datetime, lab_name varchar(100) )

    INSERT INTO abc( '10001' , '2015-07-13 14:01:023' , 'K' );

    INSERT INTO abc( '10001' , '2015-07-13 14:01:023' , 'K' );

    INSERT INTO...

  • RE: Expand coma separated values in field in select statement

    robert.wiglesworth (7/13/2015)


    Ok, yes, that's true. But what if I wanted to do something like this:

    select * from #temp t where t.color in ('red','blue')

    and still get record number 4 because red...

  • RE: Extract the titles from XML

    SQLRNNR (7/13/2015)


    Maybe so, but look at the XML plans for the larger data set versus the small data set - same plan. By using the text() it eliminates that...

  • RE: Expand coma separated values in field in select statement

    robert.wiglesworth (7/13/2015)


    Consider the following data:

    create table #test

    (id int

    ,color varchar(20)

    )

    insert into #test

    (id, color)

    values

    (1, 'blue'),(2, 'red'),(3,'green'),(4,'red,green')

    In this example, if I wanted to run a query to select any records...

  • RE: Extract the titles from XML

    Mikael Eriksson SE (7/13/2015)


    Doing it with a ten million leaf nodes instead of just four might deliver quite different results. :hehe:

    FYI: the plan will be identical regardless of what your...

  • RE: Extract the titles from XML

    Mikael Eriksson SE (7/13/2015)


    Eirikur Eiriksson (7/13/2015)


    SELECT

    NAME.DATA.value('.','NVARCHAR(128)')

    FROM @TXML.nodes('//name') AS NAME(DATA)

    SET STATISTICS TIME,IO OFF;

    SET STATISTICS IO,TIME ON;

    SELECT

    NAME.DATA.value('.','NVARCHAR(128)')

    FROM @TXML.nodes('/STUFF_FROM_MSDB/SYSTABS/name/text()') AS NAME(DATA)

    //name and /STUFF_FROM_MSDB/SYSTABS/name/text() is not...

  • RE: Anyway to SUM(Sum(ColA)) + (SUM(ColB)) + (SUM(ColC))) when there are NULLS in all of them?

    BG101 (7/13/2015)


    Basically I need to get the SUM of the sum of three columns and all three columns have nulls. To make it more complicated, the result set must return...

  • RE: Extract the titles from XML

    TomThomson (7/13/2015)


    Eirikur Eiriksson (7/13/2015)


    This is a very trivial example, the structure of the XML and the size makes it ill fit for any performance testing.

    😎

    Yes, quite so. 😎

    Doing it...

  • RE: Extract the titles from XML

    Further on the discussion, here is a small test sample

    😎

    USE msdb;

    GO

    SET NOCOUNT ON;

    DECLARE @TXML XML = (

    SELECT --TOP 200

    *

    FROM sys.tables ST

    INNER JOIN...

  • RE: Extract the titles from XML

    SQLRNNR (7/13/2015)


    Mikael Eriksson SE (7/13/2015)


    I guess this is the preferred form.

    SELECT

    col.value('(Title/text())[1]', 'varchar(50)') AS 'Book'

    FROM @x.nodes('/root/Books/Book') a(col)

    Using text() in the values clause removes one call to...

  • RE: Extract the titles from XML

    Jeff Moden (7/13/2015)


    The correct answer isn't actually available. The correct answer should be to "hunt down the moroff that used XML to transmit purely flat data and introduce him...

  • RE: Extract the titles from XML

    chgn01 (7/13/2015)


    try './/Book'

    Will work but it's far more expensive to traverse the structure than to do a direct reference.

    😎

  • RE: Measuring SQL performance

    rahmanagg (7/13/2015)


    Hi All,

    I'm working on a project comparing the performance of SQL and NoSQL database (MongoDb). I'm focusing on "insert, select, delete and update operations. I am trying to...

  • RE: Locked Out!

    jackfh (7/13/2015)


    I don't think that's it, our older prod instance appears to be configured the same way. I've tried logging in as domain admin and local admin.

    Suggest you...

  • RE: Are the posted questions getting worse?

    GilaMonster (7/13/2015)


    Brandie Tarvin (7/13/2015)


    GilaMonster (7/13/2015)


    Yes, yes, yes, yes!!!!!!!!

    Congratulations. You have complied with the requirements prescribed for your degree, and are cordially invited to the graduation ceremony

    YAY!

    What is the degree in?

    M.Sc...

Viewing 15 posts - 4,936 through 4,950 (of 8,761 total)