Forum Replies Created

Viewing 15 posts - 181 through 195 (of 692 total)

  • RE: The T-SQL Quiz

    Takes 15 seconds on my laptop.  Dual-core x64 (1.8 ghz, I think?) with 2 GB of RAM, running Vista/SQL 2005 SP2.

  • RE: Question of the Day for 29 May 2007

    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

     

  • RE: The T-SQL Quiz

    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...

  • RE: The T-SQL Quiz

    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...

  • RE: The T-SQL Quiz

    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...

  • RE: Question of the Day for 29 May 2007

    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...

  • RE: The T-SQL Quiz

    "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...

  • RE: The T-SQL Quiz

    What infamous memory leak are you referring to?

  • RE: The T-SQL Quiz

    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...

  • RE: The T-SQL Quiz

    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 %...
  • RE: The T-SQL Quiz

    Great, thanks for setting me straight!

  • RE: The T-SQL Quiz

    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!

  • RE: The T-SQL Quiz

    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...

  • RE: The T-SQL Quiz

    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...

  • RE: User Defined Data Types in SQL Server 2005

    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...

Viewing 15 posts - 181 through 195 (of 692 total)