Viewing 15 posts - 121 through 135 (of 223 total)
declare @i varchar(25)
set @i='2009-NOV'
select datename(month,cast(@i as datetime))
December 9, 2009 at 2:51 am
Hi Arun,
Thank you for the clarification. I can see the difference now. Can the result be achieved by using rollup?
December 9, 2009 at 2:12 am
I am still learning.. Can you please let me know where i am going wrong. Please see below the results from Arun and mine.. They look same to me.
Arun's Results:
CCIDSnoItemAmount
XX11AA10
XX12BB30
XX13BB40
XX23CC30
XX24DD40
XX25EE50
XX26EE120
XX36FF50
XX37FF50
Mine:
CCIDAmountSNOitem
XX1101AA
XX1302BB
XX1403BB
XX2303CC
XX2404DD
XX2505EE
XX21206EE
XX3506FF
XX3507FF
December 9, 2009 at 1:41 am
From the data provided above. This should work as well:
select CCID,SUM(Amount) as Amount,case when Sno IS Null then MAX(Sno)+1 else Sno end SNO,MAX(item) as item
from #temp1
group by CCID,SNO
with Rollup
having...
December 8, 2009 at 8:06 am
As mentioned by Gail above:
DECLARE @Input Varchar(40)
SET @Input='Hi I ''ll be there @6''O clock'
Select @Input
December 1, 2009 at 8:08 am
It's Brilliant. It works. Thank you very much.
December 1, 2009 at 1:25 am
This is what i wanted to ask:
I have a table as below:
CREATE TABLE #MyTempTable2 (qty INT, startdate datetime, enddate datetime);
INSERT INTO #MyTempTable2 VALUES (1,'2009-01-01 00:00:00','2009-01-25 00:00:00');
INSERT INTO #MyTempTable2...
November 30, 2009 at 1:38 am
Thank you so much. It works fine.
Just got another question: Will this logic still work if i wanted to do it for each week or each month instead of each...
November 28, 2009 at 4:25 am
i tried this:
; WITH
t1 AS (SELECT 1 N UNION ALL SELECT 1 N),
t2 AS (SELECT 1 N FROM t1 x, t1 y), ...
November 27, 2009 at 4:42 pm
I haven't got a calendar table. Is it possible to do this without creating the tally table.
November 27, 2009 at 9:38 am
Thank you Gail for your article. It's a brilliant artice. It is much clearer now how indexes work.:-)
November 23, 2009 at 2:56 am
I have tried with 2, 4 ,8 and then 12.. but the number/pct is not going down for cxpacket.
October 29, 2009 at 3:53 pm
Thank you guys for the replies. I have temporarily fixed it by doing another join to the eventlog table.It takes 4 seconds now. Thank you grant for pointing me to...
October 27, 2009 at 7:58 am
Hi Grant
looking at the execution plan whichs tables do you think needs indexes.
October 25, 2009 at 1:50 pm
Thank you Grant for your response.
I did run sp_updatestats to update the statistics. Do i have to update the statistics again. As far as missing index is concerned how did...
October 24, 2009 at 1:57 am
Viewing 15 posts - 121 through 135 (of 223 total)