Viewing 15 posts - 256 through 270 (of 1,438 total)
Like this
SELECT
A.*
FROM
OPENXML(@Payrollhandle,'/Payroll/Doctor/WorkDays/Office',8)
WITH (DoctorID INT '../../@ID',
StartDate DATE '../../../@StartDate',
EndDate DATE '../../../@EndDate',
WorkDaysOfficeID VARCHAR(10) '@ID',
WorkDays INT '.'--,
--AsstDaysOfficeID VARCHAR(10) 'AsstDays/Office/@ID',
--AsstDays INT 'AsstDays/Office' ,
--PTODaysOfficeID VARCHAR(10) 'PTODays/Office/@ID' ,
--PTODays INT 'PTODays/Office'
)
AS A
October 24, 2013 at 3:02 am
DECLARE @PayrollXML XML = CAST(@Payrolldoc AS XML)
SELECT doctor.r1.value('@ID','INT') AS DoctorID,
doctor.r1.value('../@StartDate','DATETIME') AS StartDate,
doctor.r1.value('../@EndDate','DATETIME') AS EndDate,
...
October 24, 2013 at 2:48 am
Yes, you just need to change the ORDER BY clause
;WITH Dups AS (
SELECT
[Patient_Count]
,[Read_code7]
,[Read_code]
,[Current_Caseload_Holder]
,[Staff_number]
,[Event_date]
,[Event_done_at],
ROW_NUMBER() OVER (PARTITION BY [Read_code7],[Read_code],[Staff_number] ORDER BY CASE WHEN [Current_Caseload_Holder] IS NOT NULL THEN 0 ELSE 1 END,...
October 23, 2013 at 8:15 am
Use ROW_NUMBER, have a look here http://www.sqlservercentral.com/articles/duplicate+data/102383/
October 23, 2013 at 6:15 am
SELECT para_value AS "PDTSHRTDE"
FROM Temp1
FOR XML PATH('PRODUCT'),ROOT('ROOT');
October 23, 2013 at 4:33 am
October 23, 2013 at 3:36 am
Decide on a suitable time for them both to start and then in one window run this
WAITFOR TIME '13:00:00'
select * from table1
and run this in the other
WAITFOR TIME '13:00:00'
select *...
October 22, 2013 at 5:44 am
DataColumn col = dt.Columns[columnName];
October 22, 2013 at 1:35 am
George M Parker (10/18/2013)
Ed Wagner (10/18/2013)
tabinsc (10/18/2013)
Victor Kirkpatrick (10/18/2013)
Might be an easy one, but I learned something: the WITH VALUES clause. Thanks.Same here
Same for me.
Same here, wasn't familiar with the...
October 18, 2013 at 9:36 am
XML is generally case-sensitive so try changing
'Saa:Header/Saa:Message/saa:Format'."
to
'Saa:Header/Saa:Message/Saa:Format'."
October 18, 2013 at 3:25 am
SELECT A.*,CA.*
FROM @Temp A
OUTER APPLY(SELECT TOP 1 B.ReportType
FROM @Temp B
...
October 15, 2013 at 6:15 am
Amongst others and in no particular order
Numbers/tally table
Calendar tables
CROSS APPLY for PIVOTing
Gap and islands via ROW_NUMBER
October 14, 2013 at 2:06 am
Your XML isn't very clear, but see if this helps
DECLARE @x XML='
<root>
<INPUT>
<CID>17064</CID>
<OwnerID>17064</OwnerID>
<TaskId>0</TaskId>
<MSG>test...
October 10, 2013 at 6:35 am
Something like this?
DECLARE @x XML = '
<Root>
<device id ="40">
<sensor id = "256">
</sensor>
<sensor id = "258">
</sensor>
<sensor id = "259">
</sensor>
</device>
<device id ="51">
<sensor id = "1011">
</sensor>
<sensor id = "1012">
</sensor>
</device>
</Root>
'
SELECT x.device.value('@id[1]','INT') AS deviceID,
...
October 10, 2013 at 5:52 am
Use CROSS APPLY
DECLARE @t TABLE(c1 INT, c2 INT, c3 INT, c4 INT)
INSERT INTO @t(c1,c2,c3,c4)
VALUES(2,4,6,5);
SELECT ca.column1,ca.column2
FROM @t
CROSS APPLY(VALUES('c1',c1),('c2',c2),('c3',c3),('c4',c4)) ca(column1,column2);
October 8, 2013 at 4:15 am
Viewing 15 posts - 256 through 270 (of 1,438 total)