Loading ...
Sorry, an error occurred while loading the content.
 

Generating fixed length random number in sql

Expand Messages
  • RAJAN SHARMA
    how to generate fixed length random number in sql for each record inserted. EARLY REPLY IS HIGHLY AWAITED. Bollywood, fun, friendship, sports and more. You
    Message 1 of 4 , Jun 24, 2008
      how to generate fixed length random number in sql for each record inserted.
      EARLY REPLY IS HIGHLY AWAITED.


      Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/

      [Non-text portions of this message have been removed]
    • sunil john
      Dear Rajan, your can use below code to generate random numbers. SELECT cast(((9999 - 1000) * Rand() + 1000)as int) -- will generate random numbers between
      Message 2 of 4 , Jun 24, 2008
        Dear Rajan,

        your can use below code to generate random numbers.

        SELECT cast(((9999 - 1000) * Rand() + 1000)as int) -- will generate random numbers between 9999 and 1000 (so all will be fixed length of 4)
        SELECT cast(rand()*1000 as int) -- any random number

        Best Regards


        Sunil John



        ----- Original Message ----
        From: RAJAN SHARMA <rajans22in@...>
        To: sqlcon@yahoogroups.com
        Sent: Tuesday, June 24, 2008 11:05:46
        Subject: MUGH-SQLCON Generating fixed length random number in sql


        how to generate fixed length random number in sql for each record inserted.
        EARLY REPLY IS HIGHLY AWAITED.

        Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos yahoo.com/ groups/bestofyah oo/

        [Non-text portions of this message have been removed]



        Send instant messages to your online friends http://uk.messenger.yahoo.com

        [Non-text portions of this message have been removed]
      • kanchan verma
        what is required regards ... Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
        Message 3 of 4 , Jun 25, 2008
          what is required


          regards


          --- On Fri, 20/6/08, Chandra Sekhar <acshakey@...> wrote:

          > From: Chandra Sekhar <acshakey@...>
          > Subject: MUGH-SQLCON Required - SQL Server Programmer - Hyderabad
          > To: sqlcon@yahoogroups.com
          > Date: Friday, 20 June, 2008, 12:04 PM
          > Hi
          >  
          > We require an SQL Server Programmer to work for an MNC
          > based in Hyderabad.
          >  
          >  
          > thanks and regards,
          > Chandra
          >  
          >
          >
          > Meet people who discuss and share your passions. Go
          > to http://in.promos.yahoo.com/groups/bestofyahoo/
          >
          > [Non-text portions of this message have been removed]


          Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
        Your message has been successfully submitted and would be delivered to recipients shortly.