Questions tagged [varchar]

A varchar or variable character field is a set of character data of indeterminate length.

A varchar or variable character field is a set of character data of indeterminate length. The term varchar refers to a data type of a field (or column) in a database management system. Varchar fields can be of any size up to the limit. In case of Microsft SQL Server, from SQL Server 2005 varchar fields don't need to be limited by using varchar(max).

1443 questions
-2
votes
1 answer

Table will not insert the row when an entry contains a "@"

I am attempting to store an email address into a database. The column is set to varchar, 200 length, utf8-unicode-ci. Whenever I try to insert data that has an "@" in it, nothing happens. It does not return an error and it nothing else submits. It's…
Kyle Messner
  • 111
  • 1
  • 1
  • 6
-2
votes
3 answers

Append character in front of a number + varchar

I have a table named Table1 which has a varchar, named Col1. I want to create a Table2 and add a leading "0" in front of the contents of Col1. How can I add a zero character to the front of a varchar? I have tried several ways but none seems to…
Sadat Mainuddin
  • 309
  • 3
  • 7
  • 19
-2
votes
3 answers

converting datetime in varchar and using it in where clause in Sql server 2005

This is a sql query that i am working on. It is dumping the filtered result in a temp table it is giving an error stating "Incorrect syntax near ','." Query. DECLARE @year VARCHAR(50) SET @year = '2012' SELECT [DAGName] …
ankur
  • 4,565
  • 14
  • 64
  • 100
-3
votes
1 answer

Convert varchar "18-MAR-13" to Date in SQL Server

Varchar value "18-MAR-13" needs to be smartly converted to date as "18-03-2013" in DD-MM-YYYY format. None of CAST, TRY_CAST, CONVERT, TRY_CONVERT worked. I have tried with CONCAT, but it got too long.
BTurkeli
  • 91
  • 1
  • 2
  • 15
-3
votes
1 answer

To handle special characters in SQL server database, which should be used varchar or nvarchar?

I am asking a simple question that, to handle special characters in my Mobile/Tablet web app, which data types should I use? Varchar NVarchar Text NText EDIT: IMPORTANT! ntext, text, and image data types will be removed in a future version of SQL…
TAB
  • 1,944
  • 8
  • 28
  • 45
-3
votes
2 answers

Conversion of varchar to time failed in SQL Server 2014

My table: When I convert it to time, it fails while selecting from table: But, when I test it in string, then there is no issue. What is the problem? I don't know.
-3
votes
1 answer

varchar and nvarchar are not supported in PostgreSQL?

While creating table using pgAdmin (PostgreSQL UI), I could see that name are getting datatype as text. Which means in PostgreSQL there is no support for varchar and nvarchar ? If so, please suggest what are the datatypes that will not supported by…
Shesha
  • 1,857
  • 6
  • 21
  • 28
-3
votes
2 answers

Extract names from varchar column in SQL Server

It is a simple test for me to do in SQL, I cant find any solution to do this. I have a below table name summary, user +----+--------------------------------------------------------------------------------------------+ | id | …
Ragul
  • 496
  • 6
  • 20
-3
votes
2 answers

Sort varchar column in mySql

I am trying to sort one column having values FMOL1001, FMOL1004, FMOL1009, FMOL10010, FMOL1003, FMOL10025 But it is not sorting properly,please help
Sushil Kawad
  • 25
  • 1
  • 1
  • 8
-3
votes
1 answer

PostgreSQL: Can we use "varchar" instead of "nvarchar" in PostgreSQL?

Can we use varchar instead of nvarchar for same use in PostgreSQL? Because I am unable to use nvarchar in PostgreSQL.
Sarfaraz Makandar
  • 5,933
  • 16
  • 59
  • 84
-4
votes
1 answer

Varchar can not save for PHP: while

I have two table buy_temp and buy_detail, i need transfer data from buy_temp to buy_detail with the same row name or types. For the first step i will get data from buy_temp like this : $sid = $db->data("email", $user_session); $sql =…
Tom
  • 11
  • 3
-4
votes
1 answer

Convert DataType

How can I change the datatype of a column in Teradata from Integer to VARCHAR(30) and VARCHAR to Integer but keep the fields null?
-4
votes
2 answers

converting varchar to integer

I am trying to count the number of records in the Face column that is between 0 and 25000. The dataset has Face as a char(20) so I needed to convert it to an integer before making any boolean expression. Here's my code below: SELECT count(*) FROM…
user3120288
  • 1
  • 1
  • 1
-4
votes
1 answer

SQL 2005 compare Date saved as VARCHAR

I have saved dates as VARCHAR in sql server 2005 now I want to select all dates before 2013 and I can't. WDATE 09/01/2012 08/13/2012 I want to compare those dates with any other date I am using this query: SELECT * FROM Work_Order WHERE WDATE…
Ahmed Kato
  • 1,697
  • 4
  • 29
  • 53
-4
votes
1 answer

I have mistake in database

When creating a table as follows create table Ticket ( ticket_id integer not null primary key, AirlineName varchar not null, CustomerName varchar, fromCity varchar, toCity varchar, fltNo integer, TicketDate date, Dtime TIME, Atime time, price…
tara7el
  • 21
  • 2
1 2 3
96
97