Viewing 15 posts - 151 through 165 (of 1,438 total)
Try this
SELECT rd.id,
x.r.value('local-name(.)','varchar(30)') AS Element,
...
August 4, 2016 at 5:53 am
Your XML isn't valid, but this is roughly what you want
update t1
set jobno = t2.jobxml.value('(/root/job/@jobno)[1]','int')
from tblJob t1
inner join #tmpJob t2 on t2.jobid = t1.jobid
July 22, 2016 at 7:33 am
Eirikur Eiriksson (7/17/2016)
😎
;WITH XML_CONVERT AS
(
SELECT
XN.XN_ID
...
July 17, 2016 at 2:20 am
If you have a fixed number of Name/Value pairs you can do this
SELECT TOP 1000
[AppActionNameID]
,CAST([AppActionParams] AS XML)
,CAST([AppActionParams] AS XML).value('(/BounceProperties/Name[1])[1]','varchar(20)') AS Name1
,CAST([AppActionParams] AS XML).value('(/BounceProperties/Value[1])[1]','varchar(50)') AS Value1
,CAST([AppActionParams] AS XML).value('(/BounceProperties/Name[2])[1]','varchar(20)') AS Name2
,CAST([AppActionParams]...
June 30, 2016 at 8:10 am
You can concatenate using 'FOR XML PATH...'
DECLARE @mytable TABLE(PolNo INT, [YEAR] INT, Platform VARCHAR(3), Number INT, Record INT, memo VARCHAR(30))
INSERT INTO @mytable(PolNo, [YEAR], Platform, Number, Record, memo)
VALUES
(123,2010,'pc',1,1,'The user had issues'),
(123,2010,'pc',1,2,'with...
June 10, 2016 at 9:34 am
Try this
with src as (
select d.Area,d.AccountNum,d.PolicyNum,d.SetId,d.LocId,d.LocDedAmt,d.NonLocDedAmt,
(select cast(d2.SetId as varchar(10)) + ',' as "text()"
from @DedTest d2
where d2.Area = d.Area
and d2.AccountNum = d.AccountNum
and d2.PolicyNum...
May 23, 2016 at 10:23 am
Really enjoyable few days, lots of excellent presentations, Itzik Ben-Gans was simply brilliant. Also got a chance to briefly meet Grant and Steve.
May 9, 2016 at 6:15 am
Finally got a chance to go this year - doing Wednesday to Saturday.
April 27, 2016 at 9:23 am
Alan.B (2/23/2016)
February 24, 2016 at 6:30 am
A couple of tweaks to Chris's query should do it
SELECT
*
,dr=DENSE_RANK() OVER(PARTITION BY pkLocalPatientLocalID ORDER BY grp)
FROM
(
SELECT
*
,grp=MIN(StartDateTime) OVER(PARTITION BY pkLocalPatientLocalID,WardLocation,rn2 -...
February 17, 2016 at 6:16 am
Does your XML have an encoding attribute such as
<?xml version="1.0" encoding="UTF-16"?>
June 9, 2015 at 2:23 pm
Try using Jeff Modens string splitter
http://www.sqlservercentral.com/articles/Tally+Table/72993/
SELECT s.Item AS Sponsor
FROM NewTreeTable n
CROSS APPLY dbo.DelimitedSplit8k(n.Tree,'\') s
WHERE n.AccountID = 1496
AND s.Item <> n.AccountID;
June 9, 2015 at 5:35 am
srikantchary4u (5/25/2015)
You made my day.
This is my first post to this forum and it worked like a charm..Thanks again 🙂 !!
Hoping to come...
May 26, 2015 at 12:38 am
Your requirements are a bit unclear but this may work for you
WITH CTE AS(
SELECT book,position,
ROW_NUMBER() OVER(PARTITION BY position ORDER BY book) AS rn
FROM...
May 25, 2015 at 1:53 pm
Viewing 15 posts - 151 through 165 (of 1,438 total)