Skip to content

Double D's Blog

  • Home
  • About Derreck Dean

Top Posts & Pages

  • Map query string parameters to properties of an object, easily`
  • FizzBuzz in one line C# Linq
  • Converting all date/time properties of an object graph to local time from UTC
Skip to content

Double D's Blog

Professional Enterprise Application Development Guides

Tag: t-sql

Uncategorized

Select a random number in T-SQL

Posted on November 20, 2012 by derreckdean

This selects a random integer between 0 and 59:
SELECT CAST(RAND(CAST(CAST(newid() as binary(8)) as INT)) * 60 AS INT)

0
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Double D's Blog
    • Already have a WordPress.com account? Log in now.
    • Double D's Blog
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar