Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 6,036 total)

  • RE: Converting a XML datatype to varchar(max).

    Thanks, it's clear now.

    It must be a bad habit of going every time via variables with explicitly defined types (either scalar or table ) which prevented me from hitting this...

  • RE: Searching set of words by ignoring spaces

    Another unorthodox method to get rid of repeating spaces:

    SELECT s.Sometext,

    (

    SELECT ' ' + LTRIM(RTRIM(Item))

    FROM dbo.Split(Sometext, ' ')

    WHERE Item > ''

    FOR XML PATH(''), TYPE

    ).value ('./text()[1]', 'varchar(max)')

    FROM...

  • RE: Searching set of words by ignoring spaces

    Luis Cazares (8/24/2016)


    Sergiy (8/24/2016)


    There was an article from Jeff Moden how to replace any number of consecutive spaces with a single one without recurring REPLACE calls.

    I don't have it handy,...

  • RE: Searching set of words by ignoring spaces

    And TABs too

  • RE: Searching set of words by ignoring spaces

    And you probably want to replace CR+LF with a space at the very beginning, as "SET NOCOUNT ON" for SQL Server is the same as

    SET

    NOCOUNT

    ON

    CREATE TABLE #Sample(

    Sometext...

  • RE: Searching set of words by ignoring spaces

    There was an article from Jeff Moden how to replace any number of consecutive spaces with a single one without recurring REPLACE calls.

    I don't have it handy, but it goes...

  • RE: How do trigger events operate?

    Lee Hopkins (8/23/2016)


    i query the Audit table Select count(*) from audit where tablename = TAGID

    Let's make sure:

    any chance you have (NOLOCK) on this query?

  • RE: Converting a XML datatype to varchar(max).

    mister.magoo (8/23/2016)


    To answer your question about how (not getting involved in why)

    declare @x xml;

    select @x=(

    select ''+b

    from

    (

    select 'hello;friend'+CHAR(13)+CHAR(10)

    union all

    select 'my;world'+CHAR(13)+CHAR(10)

    )a(b)

    for xml path(''),type);

    select @x.value('(./text())[1]','nvarchar(max)')

    the important things are to use ",type" in...

  • RE: Parallel insert in a table

    sqlenthu 89358 (8/24/2016)


    sqlenthu 89358 (8/23/2016)


    Hi,

    I was going through the concept of service broker but little confused. Can I make insert into table using following code:

    DECLARE @SBDialog uniqueidentifier

    DECLARE @Message NVARCHAR(128)

    BEGIN DIALOG...

  • RE: Parallel insert in a table

    sqlenthu 89358 (8/24/2016)


    Sergiy (8/23/2016)


    sqlenthu 89358 (8/21/2016)


    sp_executesql works in sequential order only.

    I wonder - where does it come from?

    Does it work parallel as well ? I mean if I write...

  • RE: Parallel insert in a table

    sqlenthu 89358 (8/21/2016)


    sp_executesql works in sequential order only.

    I wonder - where does it come from?

  • RE: Index on table with 70+ million rows

    Jeff, just...

    Please...

    Don't go to "their" campus with a shotgun.

    Please.

    You're not gonna have enough bullets for "them" all anyway.

    🙂

  • RE: Index on table with 70+ million rows

    Ok, there is another option.

    Count records grouped by, say, a week.

    And reload only the rows which belong to weeks where the counts are different.

    If a record was updated you'll reload...

  • RE: Index on table with 70+ million rows

    Rowan-283474 (8/23/2016)


    Rowan-283474 (8/23/2016)


    Sergiy (8/23/2016)


    Sergiy (8/22/2016)


    Do you really have the case when the source table does not have any kind of time stamp or an auto-incremental ID?

    Can you answer this?

    Yes unfortunately...

  • RE: Mistakes Columbus made.

    To help you understand:

    1500-02-29 - is it a valid date?

    Did 29 Feb exist in the calendar of year 1500?

Viewing 15 posts - 1,231 through 1,245 (of 6,036 total)