sqldatatypes Questions

6

I have a nvarchar column in one of my tables. Now I need to convert that column values to INT type.. I have tried using cast(A.my_NvarcharColumn as INT) and convert (int, N'A.my_NvarcharCo...
Medallist asked 19/10, 2012 at 5:22

4

I have a C# property which is of data type bool and when it gets set, it becomes a True or False. However I need for it to match up with a SQL Server table column of type bit so that it is saved a...
Fowlkes asked 17/9, 2015 at 6:58

6

Solved

I recently encountered a problem caused by a typo in the database creation script, whereby a column in the database was created as varchar(0) instead of varchar(20). I expected that I would have g...
Floatable asked 4/2, 2014 at 14:43

9

Solved

Yesterday I wanted to add a boolean field to an Oracle table. However, there isn't actually a boolean data type in Oracle. Does anyone here know the best way to simulate a boolean? Googling the sub...
Katakana asked 27/8, 2008 at 13:16

9

Solved

I am specifically thinking about unsigned int. Here is a practical example: what do you do when your identity column maxes out? It's possible to either go BigInt (8 bytes storage instead of 4) or...
Though asked 15/12, 2010 at 15:57

10

Solved

I'm generating UUIDs using PHP, per the function found here. Now I want to store that in a MySQL database. What is the best/most efficient MySQL data type for storing UUID v4? I currently have varc...
Inotropic asked 27/3, 2017 at 20:47

3

Solved

We imported database into BigQuery but a lot of columns are not in correct data types, many of them are stored as STRING. I want to fix them by change the data type in BigQuery ALTER TABLE my.data_...
Cranford asked 16/5, 2022 at 14:5

3

Dear Stack Overflow Community, I have a little problem here with starting my first attempt to Database-Design. I try to make some Kind of a tabular and try to check out the Basic functions; writi...
Trella asked 31/5, 2017 at 14:13

15

Solved

How can I get a list of column names and datatypes of a table in PostgreSQL using a query?
Tintoretto asked 25/11, 2013 at 13:50

4

Solved

I am trying to update a column of type integer to numeric(2) in postgres ALTER TABLE employee_status ALTER COLUMN status TYPE numeric(2); but getting the error ERROR: cannot alter type of a colum...
Euphrasy asked 8/7, 2020 at 11:4

5

Solved

I am new to DynamoDB. I wish to create a table which using DeviceID as the hash key, Timestamp as my range key and some data. { DeviceID: 123, Timestamp: "2016-11-11T17:21:07.5272333Z", X: 12, Y: ...

14

Solved

I want to store many records in a MySQL database. All of them contains money values. But I don't know how many digits will be inserted for each one. Which data type do I have to use for this purpos...
Appose asked 23/10, 2012 at 12:25

13

Solved

What is the best practice for creating a yes/no i.e. Boolean field when converting from an access database or in general?
Calling asked 22/11, 2009 at 0:13

6

Solved

I need to change column datatypes in a database table from varchar to nvarchar in order to support Chinese characters (currently, the varchar fields that have these characters are only showing ques...
Cioban asked 16/11, 2011 at 19:39

10

Solved

What is the best SQL data type for currency values? I'm using MySQL but would prefer a database independent type.
Avram asked 10/3, 2009 at 1:36

3

Solved

I am working with a table in a PostgreSQL database that has several boolean columns that determine some state (e.g. published, visible, etc.). I want to make a single status column that will store ...
Silicate asked 3/4, 2012 at 10:32

2

I used to use Varchar to text string of dynamical string length. Recently I saw people also use String with length to define it. What is the difference between them? Which one is better to use?
Eugene asked 14/12, 2016 at 6:27

3

Solved

Hi i am trying to convert a column in my table from varchar to json and the table already had some string data. I tried doing that with the below command. Database=# alter table table_name alter c...
Transversal asked 6/2, 2020 at 10:50

40

Solved

Would you recommend using a datetime or a timestamp field, and why (using MySQL)? I'm working with PHP on the server side.
Semblable asked 3/1, 2009 at 16:14

3

Solved

which data type should I choose for a unique key (id of a user for example) in postgresql database's table? does bigint is the one? thanks
Spoonful asked 2/8, 2012 at 13:9

3

Solved

I am experimenting with PostgreSQL coming from SQL using MySQL and I simply wish to create a table with this piece of code which is valid SQL: CREATE TABLE flat_10 ( pk_flat_id INT(30) DEFAULT 1,...
Autoerotic asked 19/1, 2016 at 17:30

6

Solved

I have a test class and an ExecutionDate property which stores only date but when we use [DataType(DataType.Date)] that also stores the time portion in database but I want only date portion. publi...

4

Solved

In Oracle documentation it is mentioned that NUMBER (precision, scale) If a precision is not specified, the column stores values as given. If no scale is specified, the scale is zero. Bu...
Hispania asked 29/1, 2015 at 5:41

3

Solved

Usually I run a script like this: ALTER TABLE [TABLE] ALTER COLUMN [Column] NVARCHAR(40); The result is that the field in the table gets converted to nvarchar. But what is the syntax for doing ...
Getup asked 22/5, 2012 at 23:22

2

Solved

I am reading about differences between JSON and JSONB datatypes on PostgreSql documentation https://www.postgresql.org/docs/13/datatype-json.html. There is this line The json data type stores an e...
Incinerate asked 17/8, 2021 at 15:39

© 2022 - 2024 — McMap. All rights reserved.