Forum Replies Created

Viewing 15 posts - 6,601 through 6,615 (of 7,636 total)

  • RE: Virtual PM's for Jeff...

    Jeff Moden (6/17/2008)


    Heh... I've got 100 PM's that I really want to keep... and Steve hasn't developed a way for me to download them, yet and I've been too busy...

  • RE: Child Node

    This works, though I honestly have no idea why:

    select T.Loc.value('(/XML/Institution/@Id)[1]','uniqueidentifier') AS [Institution]

    , t.Loc.query('.').value('(/User/Email)[1]','varchar(128)') AS [Email]

    , t.Loc.query('.').value('(/User/BusinessRoleGuid)[1]','uniqueidentifier') AS [BusinessRoleGuid]

    FROM @x.nodes('/XML/Institution/Users/User') AS T(Loc )

    🙁 *sigh* XML queries just remain so...

  • RE: Concatenate Results Into A Single Field

    rbarryyoung (6/17/2008)


    Ah, it's SQL, not CLR...

    Du'h, it's not the SQL2005 forum... :blush:

  • RE: Concatenate Results Into A Single Field

    Ah, it's SQL, not CLR. It looks like the Triangular Concatentation problem (ie., sequential cumulative string concatenation is O(n2), esp. with immutable strings), which is solvable in CLR, but...

  • RE: Error converting data type varchar to numeric.

    Jeff Moden (6/17/2008)


    rbarryyoung (6/17/2008)


    I think that you have to at a minimum include '. + -' in that list.

    And, a decimal point...

    it's in there, it's just hard to see... 🙂

  • RE: Error converting data type varchar to numeric.

    I think that you have to at a minimum include '. + -' in that list.

  • RE: Concatenate Results Into A Single Field

    Matt Miller (6/17/2008)


    Yup - I can fix the one issue on tempDB, but it still performs rather poorly on few, big groups. So - while it can beat the...

  • RE: Group By Price Ranges

    Still haven't answered my question.

  • RE: Is it possible?

    Thanks Jeff, I've added it to my briefcase.

  • RE: Child Node

    Try this:

    [font="Courier New"]DECLARE @x XML

    SET @x = '<XML>

      <Institution Id="0657F7ED-58CA-4A3D-8393-B9A3DD315319">

        <Users>

          <User>

            <Email>A@test.com</Email>

            <BusinessRoleGuid>0657F7ED-58CA-4A3D-8393-B9A3DD315319</BusinessRoleGuid>

          </User>

          <User>

            <Email>B@test.com</Email>

            <BusinessRoleGuid>1657F7ED-58CA-4A3D-8393-B9A3DD315319</BusinessRoleGuid>

          </User>

      </Users>

    </Institution>

    </XML>'

    SELECT T.Loc.value('(/XML/Institution/@Id)[1]','uniqueidentifier') AS [Institution]

    , T.Loc.value('(/XML/Institution/Users/User/Email)[1]','varchar(128)') AS [Email]

    , T.Loc.value('(/XML/Institution/Users/User/BusinessRoleGuid)[1]','uniqueidentifier') AS [BusinessRoleGuid]

    FROM @x.nodes('/XML/Institution/Users/User') AS T(Loc )

    [/font]

  • RE: Error converting data type varchar to numeric.

    Select * from Table2

    Where IsNumeric(JoinColumn) = 0

  • RE: Ranking Within a Data Set

    This is the most straightforward way, though not the fastest.

    Insert into ProcessedTable(OrderNumber, LineItemNumber, LineItemDesc)

    Select OrderNumber, LineItemNumber, MAX(LineItemDesc)

    From OriginalTable

    Group By OrderNumber, LineItemNumber

    Having COUNT(*) =...

  • RE: Eliminating Cursors

    Wilfred van Dijk (6/16/2008)


    I agree with Bob. Why write some unreadable code in order to avoid cursors? To my opinion, cursors are easy to implement, very straightforward and the extra...

  • RE: Using VBA to pull SQL data into Excel?

    Cool. I stand corrected. 🙂

  • RE: Using VBA to pull SQL data into Excel?

    montgomery johnson (6/16/2008)


    I would be interested in anything you've got. There will be future changes on additional spreadsheets.

    OK, I checked and unfortunately I do not have much useful stuff that...

Viewing 15 posts - 6,601 through 6,615 (of 7,636 total)