Viewing 15 posts - 916 through 930 (of 4,081 total)
You do it with two separate queries. One to update table "B" and then another to update table "C".
You are thinking procedurally, not set-based, whenever you say...
November 9, 2011 at 11:06 am
He's right. The round is redundundant in the second example. 😀
November 8, 2011 at 5:09 pm
Not too badly, Jason. I'm enjoying every breath I take. I remember that you had moved back to Utah. How are things going...
November 8, 2011 at 3:53 pm
daveriya (11/8/2011)
i want to order my result by 1,5 ..not with column name
Hasn't ordering by column number been deprecated?
November 8, 2011 at 3:47 pm
No guarantees on performance, but here's your overlap logic.
select ap.*,DATEDIFF(minute,start,[end]) as duration,ca.PersonId,ca.AvailFrom,ca.AvailTo,ca.MinutesOverlap
from Appointments ap
cross apply (select *,
DATEDIFF(minute, case when AvailFrom >= ap.Start then AvailFrom else ap.Start end
,case when AvailTo <=...
November 8, 2011 at 2:44 pm
... and just TRY getting a parachute through security at a U.S. airport.
November 8, 2011 at 2:03 pm
You can approach this a number of ways. One way is to pass in a table variable containing the years to be selected.
DECLARE @inputYears table (getyear char(4)...
November 8, 2011 at 1:12 pm
Everything may be RBR, but I always thought the purpose was to keep it from being RBAR, Paul 😉
November 8, 2011 at 10:06 am
I agree with Chris.
Because I inadvertantly started (this very entertaining and informative discussion) by making a "suckish" comment, I feel compelled to admit that I have in fact used...
November 7, 2011 at 3:46 pm
-- if you want to specify that your output is numeric (10,1), you will have to cast or convert the result
declare @int1 int = 4
declare @int2 int = 5
select cast(round(1.0*@int1/@int2,1)...
November 4, 2011 at 1:32 pm
-- just start out by multiplying by 1.0 then round() the result
declare @int1 int = 4
declare @int2 int = 5
select round(1.0*@int1/@int2,1)
November 4, 2011 at 1:30 pm
Gail and Lynn, it is also worth noting the the scan is feeding directly into a merge join, so no intermediate sorting or hashing is required for the join. ...
November 3, 2011 at 9:52 am
Recursive CTEs can also perform quite suckishly. There is nothing set-based about the recursion.
November 3, 2011 at 9:45 am
Question: You say "pass in a definition", but the way I read your post it seems you are wanting to avoid dynamic SQL. If you want...
October 31, 2011 at 3:26 pm
Viewing 15 posts - 916 through 930 (of 4,081 total)