Forum Replies Created

Viewing 15 posts - 436 through 450 (of 1,439 total)

  • RE: Update statement question

    Jeff Moden (11/27/2012)


    CELKO (11/27/2012)


    I should have posted this in the previous posting. Hugo makes all the arguments.

    http://sqlblog.com/blogs/hugo_kornelis/archive/2008/03/09/lets-deprecate-update-from.aspx

    I've seen all of his arguments and appreciate them but they still boil...

  • RE: Grouping Time Stamp using T-SQL

    Try this

    Select event_id, event_ts, DATEADD(minute,(1+DATEDIFF(minute, 0, event_ts)/5)*5, 0) AS time_stamp_group

    From cte_time

  • RE: Help with XQUERY

    Looks like a typo

    CROSS APPLY T.CommentsData.nodes('/comments_data/Row/id/from') AS S(N)

    should be

    CROSS APPLY T.CommentsData.nodes('/comments_data/Row/from') AS S(N)

  • RE: wiered - Self Referential Key

    You can do this in a single statement using MERGE

    MERGE fk_test AS target

    USING (SELECT 5) AS source(eno)

    ON (source.eno IN (target.eno,target.fno))

    WHEN MATCHED AND source.eno = target.eno THEN

    DELETE

    WHEN MATCHED AND source.eno =...

  • RE: Update XML tag

    change

    select @VXML.modify

    to

    set @VXML.modify

  • RE: Copy Data From One Row To Subsiquent Rows Where Blank

    Assuming you have a column SeqNum to order the rows by, you can do this

    UPDATE t1

    SET Admit_Date = ca.Admit_Date,

    Disch_Date = ca.Disch_Date,

    ...

  • RE: Xquery striping XML having problems separating records

    Try this

    SELECT x.r.value('(Contact/ContactID/text())[1]','VARCHAR(40)') AS ContactID,

    x.r.value('(Contact/Name/text())[1]','VARCHAR(200)') AS Name

    FROM @Xml.nodes('/Response/Invoices/Invoice') AS x(r)

  • RE: XML In Where Clause

    pierrebas (11/23/2012)


    Thanks "Ten Centuries", that's exactly what I was looking for, a clean solution!!!

    You're welcome. Thanks for the feedback.

  • RE: XML In Where Clause

    WITH CTE1 AS (

    SELECT [ProfileId],

    x.r.value('.','INT') AS id

    FROM [Profile]

    CROSS APPLY RelationshipTypeIDs.nodes('RelationshipTypeIDs/id') AS x(r)),

    CTE2 AS (

    SELECT x.r.value('.','INT') AS id

    FROM @RelationshipTypeIDs.nodes('RelationshipTypeIDs/id') AS x(r)

    )

    SELECT DISTINCT c1.[ProfileId]

    FROM CTE1...

  • RE: Update statement question

    CELKO (11/23/2012)


    ...

    Why use needless dialect that is about to be deprecated?

    About to be deprecated? Have you got a link for that?

    If your talking about this connect issue, it's already...

  • RE: switching address with Subtring & len funtion

    dwain.c (11/21/2012)


    Prettiness and speed are apparently not conflicting requirements:

    PRINT 'Dwain.C COLLATE + CROSS APPLY'

    SET STATISTICS TIME ON

    SELECT @Email=RIGHT(

    STUFF(a.email

    ...

  • RE: switching address with Subtring & len funtion

    Modded version of Dwains, much quicker

    PRINT 'Dwain.C COLLATE'

    SET STATISTICS TIME ON

    SELECT @Email=RIGHT(

    STUFF(email

    ,CHARINDEX('@', email COLLATE Latin1_General_BIN2)

    ...

  • RE: how to remove characters char(0) to char(31)

    Jeff Moden (11/19/2012)


    @mark-3,

    That was also pretty quick. Have you been using such a thing? If so, what's your take on performance here (And, yes, I still do the...

  • RE: how to remove characters char(0) to char(31)

    Jeff Moden (11/19/2012)


    Eugene Elutin (11/19/2012)


    Jeff Moden (11/17/2012)


    Raymond van Laake (11/16/2012)


    ...

    Regular expressions may be the fastest in another language but they're not necessarily the fastest in T-SQL because of the bit...

  • RE: need script

    Something like this?

    SELECT DB_NAME(database_id) AS DatabaseName,

    SUM(CASE WHEN type=0 THEN size ELSE 0 END) AS MdfSize,

    SUM(CASE WHEN...

Viewing 15 posts - 436 through 450 (of 1,439 total)