jackncoke
jackncoke

Reputation: 2020

Does Varchar(x) count white space?

I am looking for a cut and dry answer. I have seen posts that say it doesn't count ending white space or some say it doesn't count leading white space.

example "if this was the example" would this be a varchar(19) or varchar(23)?

Upvotes: 1

Views: 6652

Answers (3)

Andrew
Andrew

Reputation: 501

varchar's can take into account spaces, so yes it does need varchar(23).

Upvotes: 1

Rahul Tripathi
Rahul Tripathi

Reputation: 172528

The simple answer is Yes it accepts white spaces. And the output is varchar(23)

Upvotes: 2

Joachim Isaksson
Joachim Isaksson

Reputation: 180987

VARCHAR(23), since space also needs to be stored for the sentence to stay the same.

Upvotes: 6

Related Questions