SQL Server 2000General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
There is autonumber datatype (option etc) available in sql server ?
I want one field which datatype autonumber, it
will automatically insert number when data insert on each record.
1, 2 , 3, 4,.... and so on
just like in ACCESS database there is autonumber datatype in sql server ?
quote:Originally posted by rgerald
Not only will the decimal (floating point) numbers require more storage space, they will also process slower (floating point math vs. integer math).
A decimal number requires 1 extra byte to store precision and scale information. The number of bytes required to represent a given value varies with the precision of the number itself and can vary from 5 to 17 bytes (including the 'overhead' byte). Thus, it may very well require less storage space than other representations.
Decimal numbers are also not floating point numbers - they are stored internally as scaled integers and are thus exact representations of a value, unlike floating point. Since they are scaled, though, arithmetic operations require software handling (to manipulate the decimal point), so they are indeed slower than integers, but you shouldn't be doing much with arithmetic operations in the database anyway...
BTW, have you measured the performance of the floating point processor on Intel machines these days? You may be surprised at how few cycles it takes for floating point math (admittedly still far slower than integer operations).
My biggest problem with the decimal datatype is the relatively poor client support for that type.
Sorry, I have one problem on autogenerating ID too. I'm using Microsoft SQL and my IDs are in A001, A002, A003...and so on. How can I auto generate this IDs? Like A001 +1=A002? Please help...