way to genate 12 digits number with less bytes used

  • Hi, in my table i have three field

    ID--Int--Autoincrement

    UsrId---Numeric(18,0)

    UsrName --nvarchar(50) and 10 fields more

    my question is shoyuld i make user id and int or let it be numeric,b'cos i want to generate userid which will be 12 digit number

    will it hamper the speed of fetching data as one row will consist of

    4 byte + 19 byte+ 100 byte is ther anyother way to genate 12 digits number will less bytes used

  • will You please elaborate the situation/ ur requirement...

    Reagrds,

    SqlSpider:-)

  • hi ,i am creating a database and want to copy around 10 million records

    into table X which is having 10 fileds

    if you calculate in term of bytes

    int (4 byte)+ numeric (19 byte)+nvarchar( 100 bytes) ..... like this and i want to genrate 12 digits value in numeric field

    my question is can i use some other value instead of numeric tro generate 12 digits number so that some byte will reduce in a row and help me fetch data bit fast

  • Just use bigint instead of int. If you insist on it being a 12-digit number, you can either start at 100000000000, or have your presentation layer pad the number out with leading zeros.

    John

  • [font="Comic Sans MS"]You can use BIGINT instead of using numeric..[/font]

    Regards,

    SqlSpider:-)

  • Hi, thanx for your suggestion

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply