Viewing 15 posts - 766 through 780 (of 1,439 total)
Great, here's another way
WITH XMLNAMESPACES('http://www.w3.org/2001/XMLSchema-instance' AS xsi,
'http://www.w3.org/2001/XMLSchema' AS xsd,
'ns0:cape_site' AS ns1),
OrderedData AS (
SELECT jc.WBSNumber,
jst.EquipmentNo,
...
July 12, 2011 at 9:50 am
This is the query from above without the WITH XMLNAMESPACES clause
SELECT jc.WBSNumber AS "site_code",
(SELECT jst.EquipmentNo "equipment_code",
...
July 12, 2011 at 6:57 am
I'm not sure if you can do this without generating extra namespace definitions, there's a Connect item for it here
WITH XMLNAMESPACES('http://www.w3.org/2001/XMLSchema-instance' AS xsi,
'http://www.w3.org/2001/XMLSchema' AS xsd,
'ns0:cape_site' AS ns1)
SELECT...
July 12, 2011 at 6:49 am
Can you post the DDL and DML to create the sample data.
July 12, 2011 at 6:16 am
I think rearraging the calculation in dbo.fnPaymentCalc improves things a bit
Change
SELECT @payment = @loan_amt*((@calc_rate*POWER((1+@calc_rate),@periods))/(POWER(1+@calc_rate,@periods)-1))
to
SELECT @payment = @loan_amt*@calc_rate + @loan_amt*@calc_rate/(POWER((1+@calc_rate),@periods)-1)
July 11, 2011 at 4:23 am
SELECT e.emp_no AS "@emp_no",
e.ename AS "@ename",
e.manager AS "@manager",
(SELECT 'item'...
July 11, 2011 at 2:57 am
MidBar (7/10/2011)
BY giving the namespace in individual item, it worked as desired.
However, I am still not sure what's the purpose of this "*." in this clause...
July 11, 2011 at 1:56 am
Any feedback?
Did either of the solutions work for you?
July 10, 2011 at 12:31 pm
MidBar (7/8/2011)
This works with single element in body. Of course one cannot write n number of outer apply for each element in body. I have tested following and its...
July 8, 2011 at 9:01 am
This should work
select b.value('.','varchar(10)') as Item,
h.value('.','varchar(50)') as [To]
from #temp
outer apply item_xml.nodes('
declare default element namespace "http://tempuri.org/";
declare namespace s="http://www.w3.org/2003/05/soap-envelope";
declare namespace a="http://schemas.datacontract.org/2004/07/New.Specialized.NewPolicyService.DataContracts";
/s:Envelope/s:Body/ExecuteNewPolicy/NewFacts/a:NewOrders/a:NewOrder/a:item') as body(b)
outer apply item_xml.nodes('
declare...
July 8, 2011 at 7:36 am
with xmlnamespaces ( default 'http://tempuri.org/',
'http://www.w3.org/2003/05/soap-envelope' as s,
...
July 8, 2011 at 4:52 am
Uncomment /*NOT*/ for the other dataset
SELECT RU,SECTOR,ENT
FROM WBU w1
WHERE /*NOT*/ EXISTS(SELECT * FROM WBU w2 WHERE w2.SECTOR='CORE' AND w2.RU=w1.RU)
July 7, 2011 at 9:03 am
gary.proctor (7/7/2011)
Mark-101232Thank you for both the reference and the example.
This is exactly what I needed!
Thanks for the feedback.
July 7, 2011 at 6:34 am
This should give you what you want. I've added a couple of extra rows of test data.
SET DATEFORMAT MDY
DECLARE @EmployeeDaily TABLE(FileDate DATETIME, EmployeeId INT,EmployeeName VARCHAR(30),ManagerId INT)
INSERT INTO @EmployeeDaily(FileDate,EmployeeId,EmployeeName,ManagerId)
SELECT '5/1/2011' ,101,...
July 6, 2011 at 1:27 pm
Have a look here
July 6, 2011 at 12:25 pm
Viewing 15 posts - 766 through 780 (of 1,439 total)