Viewing 15 posts - 406 through 420 (of 1,082 total)
this will give you the months
SELECT
LEFT(CONVERT(VARCHAR,DATEADD(m,-n+1,GETDATE()),0),3) + ' ' + CAST(YEAR(DATEADD(m,-n+1,GETDATE()))AS VARCHAR(4))
FROM Tally
WHERE N < 14
And you can use the same type of query to work out the ranges
If...
January 30, 2009 at 7:57 am
OK cool thanks
Could you supply the indexes on these three tables please:
JobDetails
JobMeasures
Organisation
Also here is another way to do the split function without using a loop it requires a tally table...
January 29, 2009 at 9:56 am
Could you not try and chagne the functions to be inline functions?
Secondly, could you save the graphical execution plan from SSMS and attach that file, as it's easier to read.
thanks
Chris
January 29, 2009 at 9:35 am
Yip I agree, Multi-line functions in where clause are not good for performance at all as they tend to run for every row.
as mentioned the Converting of dates on your...
January 29, 2009 at 8:47 am
oops sorry no you didn't say that.
It seems to be the little person on my shoulder that keeps nagging me about it
January 29, 2009 at 4:54 am
Hi Gail,
any advice on why the Deferred naming option is a NO NO 🙂
January 29, 2009 at 4:17 am
OK I've tested this on a table of 100000 rows using the first solution with a GO and then my solution
The performance seems to be pretty much the same with...
January 29, 2009 at 3:44 am
oh.
Well will get that error because there is no deferred naming cause SQL knows which table you using and notices that the column is not there, if your select included...
January 29, 2009 at 3:34 am
Why would you do a select * in your code anyway?
January 29, 2009 at 3:29 am
OK I think I have a solution but it's messy.
But it definitely works from what I can see (but I prob wouldn't use it myself) would be interested to see...
January 29, 2009 at 2:36 am
The answer is yes
CREATE TABLE tmp
(col1 INT IDENTITY,Col2 INT)
INSERT INTO tmp VALUES(1)
SELECT * FROM tmp
INSERT INTO tmp VALUES(1)
DBCC CHECKIDENT(tmp,reseed,19)
SELECT * FROM tmp
the question is why do you want to do...
January 28, 2009 at 10:26 am
I'm not 100% sure what you asking for .
The statement you supplied will not run the update? is that what you expect?
January 28, 2009 at 8:53 am
mmm that sounds AWESOME he he he
Well once again, thanks for help Gail 🙂
I hope the OP finds this as useful 🙂
January 27, 2009 at 9:03 am
Thanks Gail,
Would there be a big difference between using the num_ordem in the Key as to having it in an Includes?
normally without a aggregate I think an includes would...
January 27, 2009 at 8:33 am
Also it seems the sort is most costly thing in your query so, I guess I need to ask why you have the current clustered index set up?
Could you clustered...
January 27, 2009 at 7:56 am
Viewing 15 posts - 406 through 420 (of 1,082 total)