Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie,How to CUSTOMIZE DATA Type?

0 views
Skip to first unread message

ken chanthan

unread,
Jul 2, 2002, 11:39:59 PM7/2/02
to
Hi All
I would like to customize(formate) datatype in SQL SERVER 2000, how should i
do?

TIA


linda deng[MS]

unread,
Jul 5, 2002, 2:13:58 AM7/5/02
to
Hi Ken,

User-defined data types are based on system-supplied data types. They allow
you to refine data types further to ensure consistency when working with
common data elements in different tables or databases. A user-defined data
type is defined for a specific database. However, user-defined data types
that you create in the model database are automatically included in all
subsequently created databases. Each user-defined data type is added as a
row in the systypes table.

You can create and drop user-defined data types by using SQL Server
Enterprise Manager or system stored procedures. Data type names must follow
the rules for identifier names and must be unique to each database. For
example,

EXEC sp_addtype city, 'nvarchar(15)', NULL
EXEC sp_addtype region, 'nvarchar(15)', NULL

EXEC sp_droptype city
EXEC sp_droptype region

For more information, please refer to Books Online. If anything is unclear,
please let me know.

Sincerely,

Linda Deng
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.

0 new messages