Viewing 15 posts - 1,456 through 1,470 (of 1,825 total)
This works fine , yes ?
drop table #MNTH_TBL1
go
drop table #RSM_KPI
go
create table #MNTH_TBL1(
MNTH integer
)
insert into #MNTH_TBL1 values(1)
insert into #MNTH_TBL1 values(2)
insert into #MNTH_TBL1 values(3)
insert into #MNTH_TBL1 values(4)
create table #RSM_KPI
(
UserName varchar(10),
Recorded_DateTime datetime
)
insert into...
September 29, 2009 at 5:09 am
Sorry ignore that , LEFT JOIN and LEFT OUTER JOIN are synonymous....
Can you provide a sample script ?
September 29, 2009 at 4:32 am
Try this, note the "LEFT OUTER JOIN"
SELECT ISNULL(RSM_KPI.USERNAME, '') AS "CONSULTANT", MNTH_TBL1.MNTH AS "MNTH"
FROM MNTH_TBL1
LEFT OUTER JOIN RSM_KPI ON MNTH_TBL1.MNTH = Cast(Month(RSM_KPI.RECORDED_DATETIME) as TinyInt)
...
September 29, 2009 at 4:27 am
You need to create a list of all the month / years you are interested in then left outer join that to your table.
September 29, 2009 at 4:15 am
Garadin (9/28/2009)
Also, if you decide not to take Jeff's word for it and want to test this yourself, make sure you don't insert the data in the exact order it...
September 29, 2009 at 2:57 am
Jeff Moden (9/28/2009)
Heh... what ordering issues?
Well , just that on your base table , you dont ( disclaimer More testing needed) need a clustered index in the order you...
September 28, 2009 at 8:47 am
If its not a blocking issue, it will be a query plan problem
Please see this article
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
September 28, 2009 at 7:56 am
Or how about this if you cant add a column to the original table.
drop table #mytab2
go
create table #mytab2
(
Idx char(1),
roll integer)
go
insert into #mytab2 (idx,roll)
select idx,NULL
from mytab
go
declare...
September 28, 2009 at 7:08 am
Or even....
declare @roll integer
Select @roll =0
;with cte(Idx , Col1 , Col2)
as
(
Select top 9999999 Idx , Col1 , ...
September 28, 2009 at 6:11 am
I concede that my guts can be wrong 😀
But just to add to the debate , this goes some way to resolving quirky update ordering issues.
I havent seen anything quite...
September 28, 2009 at 5:49 am
Please see BOL
http://msdn.microsoft.com/en-us/library/ms190806.aspx
Feel free to post back with any further queries
September 22, 2009 at 4:01 am
Simple enough with a union
select Job ,Name1_1 ,city1_1 , phone1_1
from table
union all
select Job ,Name1_2 ,city1_2 , phone1_2
from table
union all
select Job ,Name1_3 ,city1_3 , phone1_3
from table
union all
select Job...
September 22, 2009 at 3:58 am
This really is one of my pet hates. By using scalar udfs , you are seriously handicapping your system. Apart from the obvious overhead of calling a function,...
September 21, 2009 at 1:33 am
Also, with the quirk update , although you have specified index(0) are the rows guaranteed to come back in the required order ? . If you joined out to...
September 18, 2009 at 9:35 am
Viewing 15 posts - 1,456 through 1,470 (of 1,825 total)