Forum Replies Created

Viewing 15 posts - 571 through 585 (of 1,439 total)

  • RE: Order column with multiple dots in number

    Using Jeff Modens splitter here

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    SELECT level

    FROM #myTable

    ORDER BY (SELECT CAST(Item+1000 AS VARCHAR(10))+'/' AS "text()"

    FROM dbo.DelimitedSplit8K(level,'.')

    ...

  • RE: xml Question

    Here's another to try

    DECLARE @t TABLE(attribute_nameVARCHAR(10),attribute_value VARCHAR(10))

    INSERT INTO @T(attribute_name,attribute_value)

    SELECT 'SIZE','L' UNION ALL

    SELECT 'SIZE','S' UNION ALL

    SELECT 'COLOR','Black';

    SELECT CAST('<' + attribute_name + '>' + attribute_value + '</' + attribute_name + '>' AS...

  • RE: Remove the special character 'Æ' from the data

    ankita.vinculum (6/11/2012)


    Hi,

    Thanks for your solution, it works for me.

    Can u please elaborate that what is the meaning or purpose of "COLLATE Latin1_General_BIN".

    Regards,

    Ankita

    Here is a good place to start

    http://msdn.microsoft.com/en-us/library/aa174903%28SQL.80%29.aspx

    Your...

  • RE: Remove the special character 'Æ' from the data

    Try using a binary collation

    REPLACE(value COLLATE Latin1_General_BIN,'Æ',CHAR(13)+CHAR(10))

  • RE: Help creating XML file in SQL SERVER 2008

    It looks like my_sp_WriteStringToFile is saving the file using unicode instead of ansi. If you can't change it, try removing the 'encoding="UTF-8"' from the header.

  • RE: A-Z list

    All a bit unclear....

    WITH Data AS (

    SELECT name

    FROM (VALUES ('Banana'),('Clementime'),

    ('Apples'),('Appricots'),

    ...

  • RE: Tricky SQL - Please Help

    This assumes AccountVersion is contiguous

    WITH CTE AS (

    SELECT AccountID, AccountVersion, IsActive,

    ROW_NUMBER() OVER(PARTITION BY AccountID ORDER BY AccountVersion DESC) AS rn1,

    ...

  • RE: Shred Me This

    dwain.c (5/24/2012)


    Mark-101232 (5/24/2012)


    Try this, I can't see a simpler way with the XML as is.

    WITH CTE AS (

    SELECT row.value('local-name(.)', 'VARCHAR(50)') AS name

    ,row.value('text()[1]', 'VARCHAR(50)') AS...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/24/2012)


    Okay, my google-fu is in suck mode again. Anyone have links to what the effect of using NOLOCK in your queries and why you shouldn't use them?...

  • RE: Shred Me This

    R.P.Rozema (5/24/2012)


    Of course the xml should be improved on for any practical implementation, but still this challenged me. Since this is hypothetical already and on top of that Mark is...

  • RE: Shred Me This

    -- post deleted...

  • RE: Shred Me This

    Try this, I can't see a simpler way with the XML as is.

    WITH CTE AS (

    SELECT row.value('local-name(.)', 'VARCHAR(50)') AS name

    ,row.value('text()[1]', 'VARCHAR(50)') AS val

    ...

  • RE: How to uniquely number parent and child nodes while reading an xml document

    You can also use preceding-sibling for this

    select p.p.value('1+count(for $a in . return $a/../*[. << $a])','int') as parentID,

    p.p.value('@name','varchar(10)') as parentName,

    c.c.value('1+count(for $a in . return $a/../*[....

  • RE: Data Islands and Gaps - How To

    shaunna (5/22/2012)


    OK, after getting it in place and testing some data something came to light that makes this more challenging (I think:)).

    The records are not always one minute apart,...

  • RE: Query help

    SELECT a.StoreGroup,a.Store

    FROM StoreGroup a

    WHERE EXISTS (SELECT * FROM StoreGroup b WHERE b.Store=a.Store AND b.StoreGroup<>a.StoreGroup)

    ORDER BY a.Store,a.StoreGroup

Viewing 15 posts - 571 through 585 (of 1,439 total)