How to Create, Rename and Drop User Defined Datatype in Sql Server

Akshayblevel
Posted by Akshayblevel under Sql Server category on | Points: 40 | Views : 2129
CREATE TYPE ContactNo from varchar(20) --CREATE USER-DEFINED DATA TYPE
--EXEC sp_addtype ContactNo, 'varchar(20)', 'NULL' --OR YOU CAN CREATE THROUGH SP

EXEC sp_rename 'ContactNo', 'ContactNumber', 'USERDATATYPE' --RENAME USER-DEFINED DATA TYPE

EXEC sp_droptype 'ContactNumber' --DROP USER-DEFINED DATA TYPE

Comments or Responses

Login to post response