datatypes

Sql Data Type for Primary Key - SQL Server?

Which sql data type should we use for number bases primary key: int bigint numeric float ...

What's bigger than a double?

Is there a native c++ variable type that's "bigger" than a double? float is 7 double is 15 (of course depending on the compiler) Is there anything bigger that's native, or even non-native? ...

WPF HiercharchicalDataTemplate.DataType: How to react on interfaces?

Problem I've got a collection of IThings and I'd like to create a HierarchicalDataTemplate for a TreeView. The straightforward DataType={x:Type local:IThing} of course doesn't work, probably because the WPF creators didn't want to handle the possible ambiguities. Since this should handle IThings from different sources at the same time,...

How Does MySQL Store Enums?

If I have a table like this: CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') ); Is MySQL going to store those strings in every row, or internally will it use something smaller like integers to know which enum value to refer to? I want to use an enum in a table but I'm worried if it's as wasteful as storing a string in ...

Representing unlimited in database with integer data type

I have a table that saves some account limits like users. For most rows this value will be an integer. However I will also need to support storing unlimited (infinite) as a value. This might seem silly but is there a common integer value that represents unlimited (infinite)? I'd like to keep storing the values as integers. ...

How do you minimise the number of auxiliary scan descriptors for a table in T-SQL?

I've recently seen occasional problems with stored procedures on a legacy system which displays error messages like this: Server Message: Number 10901, Severity 17: This query requires X auxiliary scan descriptors but currently there are only Y auxiliary scan descriptors available. Either raise the value of the 'number o...

Real vs. Floating Point vs. Money

Why when I save a value of say 40.54 in SQL Server to a column of type Real does it return to me a value that is more like 40.53999878999 instead of 40.54? I've seen this a few times but have never figured out quite why it happens. Has anyone else experienced this issue and if so causes it? ...

What does "Standard" mean in the datatype column of describe

if you Describe dbms_transform PROCEDURE COMPUTE_TRANSFORMATION Argument Name Type In/Out ------------------------------ ----------------------- ------ MESSAGE STANDARD IN TRANSFORMATION_SCHEMA VARCHAR2 IN TRANSFORMATION_NAME ...

4 byte unsigned int in SQL Server?

Is there a 4 byte unsigned int data type in MS SQL Server? Am I forced to use a bigint? Possible Duplicate: http://stackoverflow.com/questions/1509933/sql-server-4-byte-unsigned-int ...

What datatype to use?

I need a collection that contains a set of objects linked to a double. The sequence of these pairs should be arbitrary set by me (based on an int I get from the database) and be static throughout the lifecycle. The number of entries will be small (0 ~ 20) but varying. The collection should be itteratable. I don't have to search the co...

Best practices for storing postal addresses in a database (RDBMS)?

Are there any good references for best practices for storing postal addresses in an RDBMS? It seems there are lots of tradeoffs that can be made and lots of pros and cons to each to be evaluated -- surely this has been done time and time again? Maybe someone has at least written done some lessons learned somewhere? Examples of the tra...

Python: converting strings for use with ctypes.c_void_p()

given a string: msg="hello world" How can I define this as a ctypes.c_void_p() data type? the following code yields a "cannot be converted to pointer" exception: data=ctypes.c_void_p(msg) data is required to be a void* type in C, because it is being passed to a DLL. I'm assuming there is a way to pack/unpack the string using the...

C#, hexadecimal notation and signed integers

This is a follow up question. So, Java store's integers in two's-complements and you can do the following: int ALPHA_MASK = 0xff000000; In c# this requires the use of an unsigned integer, uint, because it interprets this to be 4278190080 instead of -16777216. My question, how do declare negative values in hexadecimal notation in c#,...

Oracle Floats vs Number

I'm seeing conflicting references in Oracles documentation. Is there any difference between how decimals are stored in a FLOAT and a NUMBER types in the database? As I recall from C, et al, a float has accuracy limitations that an int doesn't have. R.g., For 'float's, 0.1(Base 10) is approximated as 0.110011001100110011001101(Base 2) wh...

ODBC to JDBC datatypes mapping

Where can I find description of how to map ODBC datatypes to JDBC? Or maybe anybody knows where source code of a jdbc-odbc bridge driver can be downloaded? ...

Database enums - pros and cons.

For example, I have a "users" table which has an enum column "type" with two possible values: "individual" and "organization." They are mutually exclusive and mandatory (each row must have exactly one value from the possible two. Would this be a good case to use enums? Why so/not? What are some pros and cons on using ENUM (set) types fo...

Which database systems support an ENUM data type, which don't?

Following up this question: "Database enums - pros and cons", I'd like to know which database systems support enumeration data types, and a bit of detail on how they do it (e.g. what is stored internally, what are the limits, query syntax implications, indexing implications, ...). Discussion of use cases or the pros and cons should take...

Decimal rounding problems

Given that Decimal.MaxValue = 79228162514264337593543950335m Why does the next line give me 7922816251426433759354395034M in the Local window instead of 7922816251426433759354395033.5m as expected? Decimal target = Decimal.MaxValue / 10m; TIA ...

Convert XML datatype in SQL 2005 into a relational resultset

I have a table in a SQL 2005 database that contains a column defined as a xml datatype. I'm trying to write stored proc that queries the xml and returns a resultset from a select statement. I've seen examples of returning scalar values or xml but not how to return a resultset. Am I going to have to use openxml or is there another solu...

Common mySQL fields and their appropriate data types

I am setting up a very small mySQL database that stores, first name, last name, email and phone number and am struggling to find the 'perfect' datatype for each field. I know there is no such thing as a perfect answer, but there must be some sort of common convention for commonly used fields such as these. For instance, I have determined...