Viewing 15 posts - 181 through 195 (of 692 total)
Takes 15 seconds on my laptop. Dual-core x64 (1.8 ghz, I think?) with 2 GB of RAM, running Vista/SQL 2005 SP2.
May 30, 2007 at 8:35 am
Yes, exception handling is certainly important, but it has little to do with how strongly cohesive a method is.
Here's a pretty good reference on the topic:
http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29
May 29, 2007 at 8:48 am
Hmm, I vaguely remember learning how to do this in high school, and Wikipedia isn't helping.
http://en.wikipedia.org/wiki/Least_common_multiple
lcm(a,b) = (a * b) / gcd(a,b)
http://en.wikipedia.org/wiki/Greatest_common_divisor
gcd(a,b) = (a * b) / lcm(a,b)
... so it's...
May 29, 2007 at 8:36 am
To be fair, a reboot does not trigger a recompile, but rather forces the queries to be re-compiled... A recompile will actually fire the recompile event, whereas a compile (or re-compile...
May 29, 2007 at 7:59 am
A simple "x times y" wouldn't do the trick in many cases. You'd have to instead find the least common multiple.
Example: 10 and 50. 10 * 50 = 500, but...
May 29, 2007 at 7:52 am
Hi Kevin,
I've never heard of such rules; do you have a link that describes them?
For what it's worth (probably not much) I've been using this example in a couple...
May 29, 2007 at 6:38 am
"A memory leak may occur in the common language runtime (CLR) if you pass a CLR user-defined data type as a parameter by using a stored procedure or the sp_executesql...
May 28, 2007 at 10:37 pm
Well there's a pretty big difference between what I call "premature optimization" and what you call "good code"; for example, I recently visited a client site where they'd created parameters...
May 28, 2007 at 6:19 pm
Here's another version, and I sure hope it complies with Sergiy's rules so that he can put this code into production on his SQL Server 2000 servers!
select case when n %...
May 28, 2007 at 5:47 pm
Oh, sorry, I didn't realize that the solution had to work on YOUR servers. I'll make sure to read between the lines next time!
May 28, 2007 at 4:17 pm
I guess I stretched the requirements to "runs in SQL Server" ... why limit yourself to T-SQL if other, better options exist?
Note that the SQLCLR solution will easily outscale any...
May 28, 2007 at 2:54 pm
Don't completely dismiss solutions that use a loop. The following SQLCLR stored proc beats your method by about 10% on my laptop.
And by the way, if I saw anyone...
May 28, 2007 at 2:28 pm
Agreed with Peter. The top uses I see for UDTs are:
A) Extension of the type system with new types and associated operators (not too many of these)
B) Binding of domain...
May 25, 2007 at 12:10 pm
Viewing 15 posts - 181 through 195 (of 692 total)