Specifies the type of data being stored (string, date, numeric, etc).

learn more… | top users | synonyms

1
vote
1answer
600 views

How can I restore the sql_variant_property of baseType back to a table variable in SQL Server

Ok, I know the title is confusing but here it goes. BTW I am using SQL Server 2008 I have a table that I am trying to use as a storage container. It has 3 columns: reportID integer, dataLabel ...
1
vote
1answer
543 views

Rounding of SMALLMONEY Data Type in SQL Server 2005

I'm on SQL Server 2005, and I am trying to figure out a rounding issue with smallmoney data types. For example, the value 1.2849, when rounded to 2 decimal places, produces 1.28, but shouldn't it ...
1
vote
1answer
138 views

Alternatives to NULL for missing data [duplicate]

I am using PostgreSQL and trying to write value constraints. Is it possible to record missing data as distinct from NULL values in a numeric field without using an arbitrary numeric value? For many ...
1
vote
1answer
122 views

Function quote_nullable(timestamp without time zone) is not unique

When I run this query on "enterprisedb 9.2", it raises an error: select quote_nullable(to_date('09-02-2014 ','dd-MM-yyyy'))::date; Error: LINE 1: select quote_nullable(to_date('09-02-2014 ...
1
vote
2answers
791 views

boolean purpose column char(0) or tinyint(1)

For Boolean purpose column which one is better: nullable char(0) or tinyint(1). I know bool is an alias for tinyint(1) , but in "High Performance MySQL" book that published by O'reilly said: "If ...
1
vote
3answers
127 views

Is there such thing as automatic ENUMs?

There are some tables that I manage which contain a string value (for example, a 4 word "Type" field). There are only a few DISTINCT strings, however the application may insert new strings that have ...
1
vote
1answer
1k views

How can I alter the type of a money-column to decimal in PostgreSQL?

I have a table in PostgreSQL where one column "vat" has type money but I would like to alter it to decimal instead. How can I do it? I tried with: alter table my_table alter column vat type ...
1
vote
1answer
39 views

PostgeSQL 9.3: What is the difference between text and pg_catalog.text?

I have a classic 3-environments setting (dev, staging and production), each with its own RDS PostgreSQL 9.3. The client/server versions are psql (9.3.5, server 9.3.3). In order to keep the schemas ...
1
vote
1answer
683 views

MongoDB Keys and casting between types

This is more of a theoretical question: Let's say I have a collection of documents, my_collection: { "_id": ObjectId("52c679ac7a23e6225b62c51f"), "date": ISODate("2014-01-06T03:48:30.737Z") ...
1
vote
1answer
5k views

Table schema column data type equivalents for Netezza 6 to SQL Server 2008

I'm trying to find a data type equivalents for data types in Netezza when migrating table schema to SQL Server. Where can I find a complete list? When getting down to brass tacks, I am specifically ...
1
vote
1answer
575 views

How to create an UTC index from a 'DATE' typed column with Oracle?

I have a Oracle database with columns of type 'DATE' which store timestamps in local time zone. I need to query this column with timestamps in UTC timezone. How do I create an index on the column ...
1
vote
1answer
369 views

Is it possible to fetch or update table data by table field type?

Is it possible to fetch or update table data by field type? If possible please tell me with a sample code.
1
vote
1answer
47 views

how to update the value of a period contained inside a bigger range

I have a tsrange like '[2010-01-01 14:00, 2010-01-01 15:00]',20 And want to update the 20 value to 15 in a range inside that, like '[2010-01-01 14:10, 2010-01-01 14:30]',15 My expected outcome ...
1
vote
1answer
21 views

Datatype for different categories in a database

I have got the following categories for accounting and cash flow purposes: Equity Contribution Distribution Valuation Debt Issuance Payment Valuation Allowance Interest ...
1
vote
1answer
149 views

Spliting Datetime into 2 Columns for Restaurant Reservation Schema?

Using PostgreSQL. The primary driver of this is that while no reservation will exist without a date and time, a user can search for and monitor reservations using a time or date or both. With a ...
1
vote
1answer
287 views

Column of generic/variable type?

In SQL, I would like to create a table which can contain generic data types. This types can change from every row. The solution I could come up to is: CREATE TABLE TagValue ( tag VARCHAR(64), ...
1
vote
1answer
112 views

Changing TEXT to VARCHAR

In a MySQL database (InnoDB) we have a table containing roughly 60.000.000 rows. One of the columns is of type text. Currently the longest entry has length 360 (found using SELECT MAX(LENGTH(value)) ...
1
vote
2answers
4k views

In MySQL, how to manually edit values of a BLOB column in few tuples?

In MySQL, how to manually edit values of a BLOB column in few tuples? For convenience of manual curation of database like this, should the column be created as BLOB or TEXT, or something else at the ...
1
vote
0answers
15 views

How to create a “match result” data type?

I'm building a football match table which contains one column "match result", which should consist of data like "3-1","0-0"... I'm wondering what kind of data type is best appropriate for it, varchar ...
1
vote
1answer
32 views

Is there a data type I can use for RA & Dec in astronomy

I need to have fields in my database for the following: RA (hh:mm:ss.00) Dec (Degrees:arcseconds:arcminutes.00) I need to have the facility to search for a range within each field. Any ideas?
1
vote
0answers
145 views

MS Access 365 When selecting Lookup Wizard, datatype is changed to Number

I want to create a relationship between my Contacts table & Ref_State table. Contacts table has field called State/Region which I want to make Data Type = Lookup Wizard Ref_State has fields ID ...
0
votes
5answers
96 views

Database with only text fields

I started working on an existing SQL Server Database System in which most of the fields are stored as text. Except some IDs all fields are varchar (phone numbers, zip codes, Dates, addresses, monetary ...
0
votes
3answers
742 views

Convert yymmdd to datetime using ssis derived column

Below are the strings representing date of birth (yymmdd). I want to convert it into datetime format and load into a database using ssis. How can I do it? In my derived column I have ...
0
votes
2answers
90 views

Adding a bool column; tracking untouched vs. false

[backstory] I have a simple database of our current Widget inventory. It averages just dozen columns across five or six tables, but has a huge number of records already. Some Widgets came with ...
0
votes
2answers
54 views

Setting for default column type

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead ...
0
votes
2answers
146 views

looping through a table type variable

I have a function that has one parameter of a table type, i want to loop through all the fields and return the column that has a null or empty value. CREATE OR REPLACE FUNCTION ...
0
votes
1answer
49 views

12 hour format time in SQL datatype

I can convert time datatype to 12 hour format using convert etc. But is there any option to save the time in 12 hour format in SQL tables using any settings or property or any other methods?
0
votes
1answer
32 views

What kind of data type to use for numbering in the Harmonized System?

The harmonized system uses a numbering that shows the hierarchy between different items. Similar to bookkeeping ledger numbers. Here is an example: 01 LIVE ANIMALS 0103 swine, live 010310 Purebred ...
0
votes
5answers
140 views

define rating column in table?

Hi I am creating database for rating the items in my list but I want to ask what this if I have five stars rating how can I do it in database "rating" column should I use Int with check constraint or ...
0
votes
1answer
119 views

Why does Oracle store time in DATE column?

I have a table with a date column. I used JDBC to save a java.util.Date object into the table. When I run following query I get date aswell as a time value: select To_CHAR(departure_date,'DD-MM-YYYY ...
0
votes
1answer
6k views

Float datatype with 2 digits after decimal point

In SQL server float datatype does not display leading zeros after decimal point declare @num as float set @num=5.20 select @num will dispaly only 5.2 But i want it to display as 5.20 After a ...
0
votes
4answers
623 views

Writing SQL statement in sqlcmd to hide the milliseconds for column type of time

I have a table called testtable that have a column named expire_time of type [time] The problem is that when I type the following in sqlcmd: select * from testtable It will return the following: ...
0
votes
2answers
4k views

work with json in oracle

Is there an easy way to work with JSON within Oracle? I have a stored procedure that I use to call web services quite often, JSON is a format that I am familiar with in web development context, but ...
0
votes
1answer
46 views

In a banking organization, why would account balance be declared as varchar and not decimal?

I worked in two organizations where I found money related columns are defined as VARCHAR data type. I didn't get correct explanation from anyone. As the database team is totally isolated with our ...
0
votes
1answer
38 views

Best datatype to store betting odds? [closed]

I have a lot of soccer betting odds (hundreds per match and thousands of matches), for example: <_10Bet_Home_Home>8.00</_10Bet_Home_Home> ...
0
votes
1answer
72 views

Why does mysql give different result for this summations? [duplicate]

Can someone help understand the following behavior? mysql> select (1/3 + 1/3 + 1/3); +-------------------+ | (1/3 + 1/3 + 1/3) | +-------------------+ | 1.0000 | +-------------------+ ...
0
votes
1answer
114 views

Inheritance discriminator column better int or varchar or enum?

What is the best practice for storing a discriminator column ? Does it make any difference ? Any pros/cons of using one over the other ? I am using MySql with Entity Framework but the question goes ...
0
votes
1answer
66 views

Initializing values to a custom data type

I have defined a custom data type which I need to use in my procedure. Give below is my data type. CREATE or REPLACE TYPE CUSTOM_DATATYPE AS object( chkinvpre VARCHAR2(100), orderid ...
0
votes
1answer
725 views

Oracle - how to reference to a field%TYPE using database links?

I have this database which includes a couple of schemas. Say I need to access schemaONE from schemaTWO. To do this, I have created a database link named "DB_ONE_LINK". I am able to access to ...
0
votes
2answers
209 views

Should numeric identifiers like serial numbers be stored as integers?

Many of our databases store numeric tracking codes (like serial numbers) as integers. There is little chance of these codes every getting alphabetic characters, but it still seems like an incorrect ...
0
votes
1answer
560 views

timeout on updating nvarchar(max) after converting datatype

I recently Upgraded to 2008 Enterprise and took the opportunity to change the biggest table in my db with the maintenance window. ran the following to change my ntext field ALTER TABLE ...
0
votes
1answer
44 views

Does a numeric field always use the same disk space?

When you have a numeric field in MySQL(MYISAM) (E.g. Integer) will it always use the same disk space, no matter what number is actually stored?
0
votes
1answer
396 views

What are commonly used database types? [closed]

There are a lot of database types. Can you list a list of the top classification of databases commonly found in schools and offices? Any help is appreciated. Hope to see compressed and summarized type ...
0
votes
0answers
29 views

Equivalent data types in Oracle database for SQL Server 2008’s uniqueidentifier and timestamp

I am working on SQL Server 2008 R2, and I have data types which is specific for SQL Server, including: UniqueIdentifier Timestamp Now I want to deploy my asp.net mvc 5 web application on an ...
0
votes
0answers
27 views

Questions about the SET DATEFORMAT command [on hold]

How do I set the dateformat for a column, where dates exist as '2014-12-28' and '2014-23-12' in the same column? I want it set as yyyy/mm/dd format.
0
votes
0answers
18 views

Best data type to store Active Directory Nullable GUID

I have a table name Employees,inside Sql Server 2008 r2. the table contain the following columns:- UserID. it is the Primary key, and it is auto generated by the DB. GUID. which will store the ...
0
votes
1answer
20 views

MySQL 5.6 Datetime Range

According to MySQL 5.6 doc, the supported range for datetime data type is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. But when I tried inserting values that are earlier than '1000-01-01 00:00:00', ...
0
votes
1answer
31 views

Blob datatype issue with log file

I am getting continuously below error message in mysqld.log [ERROR] InnoDB: The total blob data length (10152274) is greater than 10% of the redo log file size (3072). Please increase ...
0
votes
1answer
34 views

How to use timestamp/rowversion data types in Visio?

I am using Visio 2010 to create a ER diagram. When I insert the column names, I can't find timestamp or rowversion data types. Is there an alternative?
0
votes
0answers
58 views

Best practice for storing image order number in a database

I am designing a social networking website(mysql with InnoDB engine + php) where I need to store image sequence in a database. The table structure is as follows:- PicId (BIGINT, AUTO INCREMENT, PK) ...