DIFFERENCE BETWEEN CHAR AND NCHAR DATA TYPE IN SQL SERVER 2005
Similarities & Differences.
1.Both the character data types are of fixed length.
2.Char(n) is Non-unicode data type.
3.Nchar is unicode data type.
4.Character size for char(n) is 1 byte where as it is 2 bytes for Nchar.
5.Storage size is n bytes for char(n) and storage is 2 times n bytes in case of Nchar.
6.Maximum length of char(n) is 8000 and Maximum length for nchar(n) is 4000.
7.One should use nchar data type for columns that store characters
from more than one character set or when you will be using characters
that require 2 byte characters , which are basically the unicode
characters such are Japaneese , Korean or Chineese characters.
Pawan Kumar
Pawankkmr@hotmail.com
Ohayo,
Love it absolutely! So crystalline. No mumbo jumbo. No non-sense. Straight and simple. You guys need a standing ovation for your good work.
I have a table as shown below.
pid starttime endtime partid produced
1 14-04-2018 06:00 14-04-2018 14:00 2 5
2 14-04-2018 14:00 14-04-2018 22:00 2 5
3 14-04-2018 22:00 15-04-2018 06:00 2 2
4 15-04-2018 06:00 15-04-2018 14:00 34 5
5 15-04-2018 14:00 15-04-2018 22:00 34 7
6 15-04-2018 22:00 16-04-2018 06:00 2 2
7 16-04-2018 06:00 16-04-2018 14:00 2 3
8 16-04-2018 14:00 16-04-2018 22:00 2 4
9 16-04-2018 22:00 17-04-2018 06:00 2 5
10 17-04-2018 06:00 17-04-2018 14:00 2 2
I need to calculate lot wise production from above table. So that i will get below format.
Partid Prodstarttime Prodendtime Produced
2 14-04-2018 06:00 15-04-2018 06:00 12
34 15-04-2018 06:00 15-04-2018 22:00 12
2 15-04-2018 22:00 17-04-2018 14:00 16
Follow my new blog if you interested in just tag along me in any social media platforms!
Kind Regards,
LikeLike