Viewing 15 posts - 6,601 through 6,615 (of 7,636 total)
Jeff Moden (6/17/2008)
June 17, 2008 at 11:17 pm
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...
June 17, 2008 at 4:35 pm
rbarryyoung (6/17/2008)
Ah, it's SQL, not CLR...
Du'h, it's not the SQL2005 forum... :blush:
June 17, 2008 at 11:12 am
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...
June 17, 2008 at 11:09 am
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... 🙂
June 17, 2008 at 11:04 am
I think that you have to at a minimum include '. + -' in that list.
June 17, 2008 at 8:19 am
Matt Miller (6/17/2008)
June 17, 2008 at 8:17 am
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]
June 16, 2008 at 8:55 pm
Select * from Table2
Where IsNumeric(JoinColumn) = 0
June 16, 2008 at 7:51 pm
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(*) =...
June 16, 2008 at 4:44 pm
Wilfred van Dijk (6/16/2008)
June 16, 2008 at 3:27 pm
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...
June 16, 2008 at 2:50 pm
Viewing 15 posts - 6,601 through 6,615 (of 7,636 total)