Viewing 15 posts - 316 through 330 (of 355 total)
Try this:
DATEDIFF(minute, ExecutionLog.TimeStart, ExecutionLog.TimeEnd) AS TimeTaken
February 10, 2009 at 8:15 am
I think it would be possible to do this in a single query by using XQuery on the XML in the col2 column to extract the parameter values and recursive...
February 10, 2009 at 7:53 am
The expression can be simplified a little from
LAST_UPDATE > DATEADD(day, -1, DATEADD(day, DATEDIFF(day, -1, GETDATE()), -1))
AND
Last_update < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
to
LAST_UPDATE >= DATEADD(day, DATEDIFF(day, 1, GETDATE()), 0)
AND
Last_update...
February 9, 2009 at 10:42 am
Sergiy,
The task itself is stupid enough not to bother to run any benchmark tests.
I have to admit getting a bit carried away with this string manipulation problem. The only...
February 9, 2009 at 3:05 am
Just a quick question. Is there a performance difference between using the
WHERE NOT that you are using and
where <> 'I' and <> 0
Actually
WHERE NOT (X.status = 'I' AND...
February 9, 2009 at 2:58 am
Incidently, avoiding the use of the NULLIF function in these queries does give a significant performance improvement. The following compares Jeff's query with a functionally equivalent query that does not...
February 8, 2009 at 5:24 pm
Here are the 4 queries I used for the testing mentioned in my previous post. Unlike my original queries, they do return a row corresponding to every row in the...
February 8, 2009 at 3:59 pm
Who can say if I'm right other than the OP, it depends on the OP's precise requirements.
OP does state the following which Jeff's query doesn't do.
I also want to grouped...
February 8, 2009 at 2:43 pm
The following variation has a level of SELECT nesting that is one fewer, but gives the same results.
SELECT LEFT(I.name, I.P2 - 1), RIGHT(I.name, LEN(I.name) - CHARINDEX('.', I.name, I.P2 + 1))...
February 6, 2009 at 2:36 pm
You haven't provided your table schema so I have used the following in my query below:
CREATE TABLE Items (
name varchar(100) NOT NULL
)
GO
INSERT INTO Items
SELECT 'IT'
UNION ALL SELECT 'IT.Control.Bing'
UNION...
February 6, 2009 at 2:21 pm
Yep, my solution is essentially the same as Derek Dongray's, except that I use a derived table. Derek Dongray's solution is simpler and may be all you require, but mine...
February 6, 2009 at 7:25 am
If you need to retrieve those tblKandidaten records that have an associated tblK_Berufsziele record with Berufskuerzel = 'CIMP' AND another tblK_Berufsziele record with Berufskuerzel = 'INS', then the following should...
February 6, 2009 at 7:00 am
How about this.
SELECT X.group, X.status, X.countOfTickets
FROM (
select a.group, a.status, countOfTickets = count(b.tickets)
from group_tbl a
left outer join tickets_tbl b
...
February 5, 2009 at 3:12 pm
Just a reminder. If one of the column values is null, then "null + 'Test String'" will return null.
Quite true, but that's not relevant here.
The concatenation problem...
February 4, 2009 at 1:29 pm
If you have a Tally table, run this
SELECT P.lastwaittype, T.N, Code = ASCII(SUBSTRING(P.lastwaittype, T.N, 1))
FROM master.dbo.sysprocesses P
CROSS JOIN dbo.Tally T
WHERE P.spid = 51
My query results on a SQL Server...
February 4, 2009 at 6:54 am
Viewing 15 posts - 316 through 330 (of 355 total)