LoginSignup
0
1

More than 3 years have passed since last update.

char,nchar,vachar,nvarcharの違い

Last updated at Posted at 2018-10-29

備忘録です。

  • char(n) 固定長の文字を扱う。nByteまで文字をつめこめる。
  • nchar(m) 固定長の文字を扱う。文字をm個詰め込める。Unicodeに対応。
  • varcher(n) 可変長の文字を扱う。nByteまで詰め込める。
  • nvarchar(m) 可変長の文字を扱う。文字をm個詰め込める。Unicodeに対応。

補足

  • charおよびncharについて、nおよびmByte以下の場合には末尾に空白が付与される。
  • char型の最大Byte数は255Byte。これを超えた分は切り捨てられるので注意。

今後これらを使っていく上で、敢えてchar,varcharを使っていく理由はないのかなと感じました。
char,varcharを使うべきシーンがあれば教えていただけると喜びます。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1