Viewing 15 posts - 886 through 900 (of 1,439 total)
select t.*, n.l.value('.','VARCHAR(20)') as DesiredValue
from @temp t
CROSS APPLY ErrorData.nodes('/root/*[local-name(.)=sql:column("ErrorCol")]') n(l)
October 4, 2010 at 8:21 am
ColdCoffee (9/29/2010)
Mark-101232 (9/29/2010)
WITH CTE1 AS (
SELECT ID,Value,
ID-ROW_NUMBER() OVER(PARTITION BY Value ORDER BY ID) AS rn
FROM @SourceTable),
CTE2 AS (
SELECT ID,
...
September 29, 2010 at 5:07 am
WayneS (9/28/2010)
When I open up a normal query window connected to just one server, I can drag a file onto it, and a new...
September 29, 2010 at 4:34 am
Maybe this?
WITH CTE1 AS (
SELECT ID,Value,
ID-ROW_NUMBER() OVER(PARTITION BY Value ORDER BY ID) AS rn
FROM @SourceTable),
CTE2 AS (
SELECT ID,
...
September 29, 2010 at 3:33 am
SELECT DENSE_RANK() over (order by tref) Pareto,
tref.value('@costObject','sysname') [CostObject],
tref.value('@abcGrouping','sysname') [abcGrouping],
tref.value('@classGroupingId','sysname') [classGroupingId],
tref.value('@attributeType','sysname') [attributeType],
tref.value('@attributeName','sysname') [attributeName],
tref.value('@operation','sysname') [Operation]
FROM @xml.nodes('declare namespace d="http://Equazion.Reporting.Model/Paretos.xsd";
/d:ParetoDefinition/d:Paretos/d:Pareto
[not (@abcGrouping)]') as T(tref)
September 28, 2010 at 5:24 am
WITH CTE AS (
SELECT ClientID,SubClientID,DriveLetter,FreeSpace,
ROW_NUMBER() OVER(PARTITION BY ClientID,SubClientID ORDER BY FreeSpace,DriveLetter) AS rn
FROM #SerDriveInfo)
SELECT ClientID,SubClientID,DriveLetter,FreeSpace
FROM CTE
WHERE rn=1;
September 23, 2010 at 9:43 am
steve-893342 (9/22/2010)
Jeff Moden (9/22/2010)
The problem with the Tally Table related splits is that I forgot :blush: to add 1 to the length....WHERE N BETWEEN 1 AND LEN(@Parameter)+1
Shouldn't that...
September 22, 2010 at 9:05 am
SELECT Name,
SUM(CASE WHEN DATEPART(month,saledate)=1 THEN cost ELSE 0 END) AS Jan,
SUM(CASE WHEN DATEPART(month,saledate)=2 THEN cost ELSE...
September 22, 2010 at 3:59 am
Still not sure about NULL TermDate, is it later or earlier than non-NULL?
See if this works
WITH CTE AS (
SELECT
ID, CaseNumber1, DateFiled, OpenActionCode, JudgeNumber, TermDate, TermActionCodeID, ReOpenedCase, VisitJudge, CaseTypeNumber, SubmittedDate, RulingDate,
PreviousFileDate,...
September 20, 2010 at 6:30 am
Maybe using NTILE
with cte as (
select Guestid,Fname,Lname,Date,employeeid,
ntile(3) over(order by Date) as grp
from tblGuest
where employeeid = 1
)
update cte
set employeeid = case when grp=1 then...
September 20, 2010 at 4:42 am
More results attached, this time on a server.
Also SQLCLR figures are this
Tally:
Table 'Tally'. Scan count 10000, logical reads 30000, physical reads 0
Table 'CsvTest'. Scan count 1, logical reads 774, physical...
September 20, 2010 at 2:45 am
Paul White NZ (9/19/2010)
Mark-101232 (9/19/2010)
Tally:
Table 'Tally'. Scan count 10000, logical reads 30000, physical reads 0
Table 'CsvTest'. Scan count 1, logical reads 774, physical...
September 19, 2010 at 9:28 am
Paul White NZ (9/19/2010)
September 19, 2010 at 7:43 am
It's not really clear what your rules are here. Do you want the latest CaseNumber1 based on TermDate regardless of TermActionCodeID. If so, then this should work
WITH CTE AS (
SELECT
ID,...
September 19, 2010 at 3:56 am
Hi Jeff,
Results attached for my creaky Fujitsu Amilo laptop running Vista Home Premium, 2GB RAM, Intel Core 2 Duo
with SQL Server 2008 Express R2.
Query took 27 mins 49 secs to...
September 19, 2010 at 2:11 am
Viewing 15 posts - 886 through 900 (of 1,439 total)