Viewing 15 posts - 916 through 930 (of 4,080 total)
He's right. The round is redundundant in the second example. 😀
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 8, 2011 at 3:47 pm
Has it really been a year? Oh wow....
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 8, 2011 at 3:45 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 <=...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 8, 2011 at 2:44 pm
... and just TRY getting a parachute through security at a U.S. airport.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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)...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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 😉
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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)...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 3, 2011 at 9:52 am
Recursive CTEs can also perform quite suckishly. There is nothing set-based about the recursion.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 31, 2011 at 3:26 pm
Congratulations, Jeff !!
And good job to everybody at SSC for voting the man in...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 14, 2011 at 11:59 am
Viewing 15 posts - 916 through 930 (of 4,080 total)