varchar Questions

10

Solved

In a slightly heated discussion on TDWTF a question arose about the size of varchar columns in a DB. For example, take a field that contains the name of a person (just name, no surname). It'...
Ricciardi asked 11/8, 2009 at 16:18

22

Solved

Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?
Deanndeanna asked 27/9, 2008 at 19:34

5

I need MySQL to store numbers in a integer field and maintain leading zeros. I cannot use the zerofill option as my current field is Bigint(16) and numbers can vary in amount of leading zeros. IE: ...
Omora asked 29/7, 2011 at 12:51

6

Solved

I'm trying to optimize my PostgreSQL 8.3 DB tables to the best of my ability, and I'm unsure if I need to use varchar_pattern_ops for certain columns where I'm performing a LIKE against the first N...
Turney asked 3/11, 2009 at 7:17

13

Solved

What's the difference between the text data type and the character varying (varchar) data types? According to the documentation If character varying is used without length specifier, the type a...
Dude asked 31/1, 2011 at 8:44

5

Solved

I want to store Zip Code (within United States) in MySQL database. Saving space is a priority. which is better option using VARCHAR - limited to maximum length of 6 digit or using INT or using MEDI...
Crafton asked 5/4, 2013 at 21:14

5

Solved

I have a column in my SQL-2005 database that used to be a varchar(max), but it has been changed to an nvarchar(max). Now I need to update my hibernate mapping file to reflect the change, and this ...
Nagey asked 8/7, 2009 at 17:18

10

Solved

Suppose that I have a SQL table that has a varchar[1000] field called "Remarks". I would like to craft a single SQL statement, which when executed, will return 1000, or whatever the size of the va...
Ommatidium asked 18/4, 2011 at 15:34

9

Solved

I've got a messages table in MySQL which records messages between users. Apart from the typical ids and message types (all integer types) I need to save the actual message text as either VARCHAR or...
Proa asked 7/1, 2010 at 20:40

2

Solved

I am trying to concatenate a list of IDs into a varchar(max) to pass into an openquery for a bulk update of data. My question is, is there an easy way to see if a string is beyond the length a var...
Santiago asked 4/6, 2010 at 14:45

37

Solved

When I executed the following command: ALTER TABLE `mytable` ADD UNIQUE ( `column1` , `column2` ); I got this error message: #1071 - Specified key was too long; max key length is 767 bytes In...
Raglan asked 29/11, 2009 at 3:18

9

I have a varchar column where some values are in mm/dd/yyyy format and some are in yyyymmdd. I want to convert all mm/dd/yyyy dates into the yyyymmdd format. What is the best way to do this? Than...
Insulation asked 27/12, 2016 at 23:3

11

I am trying to locate some problematic records in a very large Oracle table. The column should contain all numeric data even though it is a varchar2 column. I need to find the records which don't c...
Allpowerful asked 31/10, 2011 at 17:39

6

I have a table: Account_Code | Desc 503100 | account xxx 503103 | account xxx 503104 | account xxx 503102A | account xxx 503110B | account xxx Where Account_Code is a varchar. When I create a q...
Spheroid asked 4/1, 2013 at 8:32

8

I would like to know what the max size is for a MySQL VARCHAR type. I read that the max size is limited by the row size which is about 65k. I tried setting the field to varchar(20000) but it says...
Balustrade asked 22/11, 2012 at 6:13

6

Solved

I have to get last 5 numbers using mysql. My values are like YOT-A78514,LOP-C4521 ... I have to get only last five char . How can I do this in query?
Craniology asked 13/4, 2012 at 2:44

9

Solved

I have this date format: 2011-09-28 18:01:00 (in varchar), and I want to convert it to datetime changing to this format 28-09-2011 18:01:00. How can I do it?
Cucumber asked 20/4, 2012 at 13:18

5

Solved

In Oracle, what is the difference between : CREATE TABLE CLIENT ( NAME VARCHAR2(11 BYTE), ID_CLIENT NUMBER ) and CREATE TABLE CLIENT ( NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11) ID_CLI...
Impression asked 17/9, 2008 at 9:27

2

Solved

When creating a table in knex migrations, I have indicated a col as such: table.string("content"); It defaults to varchar 255. I would like it to be able to hold more text. How do I indicate to k...
Mancy asked 5/3, 2016 at 18:23

4

Solved

How many characters can a SQL Server 2008 database field contain when the data type is VARCHAR(MAX)?
Downcast asked 19/11, 2009 at 5:37

10

Solved

I'm trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I've dropped and re-created tables before but I've never been exposed to the alter statem...
Plectognath asked 12/1, 2012 at 1:34

4

Solved

I'm trying to populate a SQL table with a list of words. The table itself it pretty simple: CREATE TABLE WORDS( ID BIGINT AUTO_INCREMENT, WORD VARCHAR(128) NOT NULL UNIQUE, PRIMARY KEY(ID) );...
Neils asked 23/6, 2011 at 2:51

3

Solved

Any benchmark, graph anything at all ? Its all academic and theoretical across the web. Ok its not the first time that this question has been asked, they all say that using CHAR results in faster...
Longsighted asked 4/8, 2010 at 19:6

7

Why do we always need to specify VARCHAR(length) instead of just VARCHAR? It is dynamic anyway. UPD: I'm puzzled specifically by the fact that it is mandatory (e.g. in MySQL).
Sexpartite asked 1/7, 2010 at 10:11

2

Solved

I have a column in database like; new_profittl ------------ 45,1000 84,0400 156,6500 169,1800 ... My code; SELECT SUM(CAST(new_profittl as DECIMAL(18,2))) FROM new_hotelreservation AS R WHERE D...
Unwrap asked 19/2, 2014 at 14:53

© 2022 - 2025 — McMap. All rights reserved.