Programming in MS SQL Server 2012

Character Data Type



SQL Server supports three different character data types. Char data type is used to stores fixed length alphanumerical data type. Varchar data type is used to stores different length alphanumerical data type. Text data type is used to stores ASCII character data type. The following example is describes a Char and Varchar Data Types.

-- Example 78 --

 

DECLARE @EmployeeName char(50),

        @CompanyName varchar(50)

SET @EmployeeName = 'Prem Nath R.K.'

SET @CompanyName = 'IONIDEA'

SELECT 'Employee Name' = @EmployeeName,

       'Company Name' = @CompanyName


Query Output Screen



More Reference URL: https://data-e-education.com/SQL/Character_Data_Types.php

* * * * *


Email Your Comment To AUTHOR