Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

tiny text and varchar

What is the different betawen Tinytex and Varchar? Please give me and example usr varchar and tiny text.
Thank
0
teera
Asked:
teera
1 Solution
 
kupra1Commented:
Although both tinytext and varchar can hold upto maximum of 256 characters, the difference is that varchar removes the leading and the trailing blankspaces whereas the tinytext keeps up as it it.
Example: create a table like this.

create table temp (col1 text, col2 varchar(10));

Now, insert values into the table.
insert into temp values('  text  ', '  text  ');

Check the database to see the values stored.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now