Viewing 15 posts - 1,306 through 1,320 (of 1,438 total)
See if this helps
create table mytable(yr int, mn char(3), Spend int)
insert into mytable(yr,mn,Spend)
select 2008, 'Jan' , 100 union all
select 2008, 'Feb' , 200 union all
select 2008, 'Mar' , 100 union...
July 10, 2008 at 5:05 am
Jeff Moden (7/9/2008)
July 10, 2008 at 2:24 am
SELECT calls.cLog.value('OperatorsName[1]', 'varchar(512)') as OperatorsName
, calls.cLog.value('Date[1]', 'varchar(512)') as...
July 9, 2008 at 4:36 am
SELECT col1 AS "@N",
col2 AS "text()"
FROM @temp
FOR XML PATH('D'),ROOT('Root'),TYPE
July 9, 2008 at 2:06 am
As an example, see if this helps
/* ItemsSold */
(SELECT SUM(item_qty) FROM FactOrder WHERE date_purchased_key = @dateKey) as TotalItemsSoldDay,
(SELECT SUM(item_qty) FROM FactOrder WHERE date_purchased_key >= @fWeekBeginKey AND date_purchased_key <= @fWeekEndKey) as...
June 28, 2008 at 1:36 am
You can use indexed views for this
http://www.sqlservercentral.com/Forums/Topic471378-338-1.aspx#bm471408
June 27, 2008 at 8:26 am
Another alternative
SELECT
A.RetailerID,
X.RetailerIDTheirs
FROM TableA AS A
CROSS APPLY (SELECT TOP 1 B.RetailerIDTheirs FROM TableB B WHERE...
June 24, 2008 at 8:32 am
Wrox : Professional C# 2008
Coming from a C++ background, I found the 2005 version of this really helpful (apart from the numerous typos)
June 24, 2008 at 7:57 am
This should perform better than your correlated subquery
SELECT p.Publisher, COUNT(b.Publisher_Ref) AS BookCount
FROM Publishers p
LEFT OUTER JOIN Books b ON b.Publisher_Ref = p.Ref
GROUP BY p.Publisher
ORDER BY p.Publisher
June 20, 2008 at 4:59 am
select cust,
count(case when prod='P' then prod end) as 'No. of Product (P)',
count(case when prod='Q' then prod...
June 19, 2008 at 5:10 am
> XPath is not exactly friendly.
Yep!
,RelOp.op.value('(./*:RunTimeInformation/*:RunTimeCountersPerThread)[1]/@ActualRows','int')
June 18, 2008 at 7:47 am
Either remove the "declare default element namespace" clause from the query or add the namespace to the XML
[RelOp xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" AvgRowSize="9" ...
June 18, 2008 at 7:16 am
The problem is that your XML could have multiple RunTimeInformation elements such as this
[RelOp AvgRowSize="9" EstimateCPU="0.0014337" EstimateIO="0.0138859"]
...
June 18, 2008 at 7:00 am
You should be able to get the overlap using this (DDL and sample data would help)
select startYear,
endYear,
...
June 18, 2008 at 5:01 am
Viewing 15 posts - 1,306 through 1,320 (of 1,438 total)