Forum Replies Created

Viewing 15 posts - 271 through 285 (of 683 total)

  • RE: Getting Random Results

    Here's the code I used (revised from the previous code to include method #4)...

     

    --table to hold results

    CREATE TABLE #Results (NumberOfTableRows INT, NumberOfRows INT, ProbabilityOfEachRow FLOAT,

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Getting Random Results

    Adrian,

    I've just had a go at implementing your suggestion on my data (I really don't have time, but I can't help myself )....

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Getting Random Results

    LOL Jeff

    Actually, the results from my tests above don't show that the data is 'more random' with checksum - only that the...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Getting Random Results

    I actually needed to use this on something, so I've just spent an hour playing around with it.

     

    Here's some testing I've...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Getting Random Results

    Using "ORDER BY CHECKSUM(NEWID())" rather than "ORDER BY NEWID()" apparently produces values with a better random distribution.

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Working with Time Frames in T-SQL

    Thanks Jeff

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Working with Time Frames in T-SQL

    Oh, and here are my favo(u)rite date links (so to speak)...

     

    http://www.sql-server-performance.com/articles/dev/datetime_datatype_p1.aspx

    http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64762

     

    I hope someone finds all this stuff useful...

     

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Working with Time Frames in T-SQL

    Incidentally, if you're using SQL 2005, you can jump straight to the final result fairly elegantly.

    Code is safe to run...

     

    DECLARE @MY_EVENTS TABLE (DESCRIPTION VARCHAR(50),...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Working with Time Frames in T-SQL

    Hi all,

    I'd approach it more like this, I think. The code below produces the same results and is safe to run...

     

    DECLARE @MY_EVENTS TABLE (DESCRIPTION VARCHAR(50),...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Advanced XML Processing

    Very nicely-presented article - well done Jacob!

    My only suggestion would be to rename this particular article to 'Simple XML Processing', as some people might be unnecessarily scared off 

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Deleting Duplicate Records

    Here's another method. This one adds an identity column, uses it, and then drops it.

    ALTER TABLE dbo.employee ADD...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Finding Primes

    Here's a selection of results when I run the above code on a server here.

     

    39 seconds to find all primes below 5...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Finding Primes

    Hi Jeff,

    Here's some code so you can run it yourself. I'll add some run results in the next post.

    --Inputs

    DECLARE @MaxNumber INT

    SET @MaxNumber...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Finding Primes

    Finding primes is something I worked on about 6 months ago (for fun, of course ). Here's a link to the work...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: The Effect of NOLOCK on Performance

    Just because I have them handy, here are a few links to discussions on this topic...

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64803

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67294

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 15 posts - 271 through 285 (of 683 total)