Friday, October 3, 2014

USER DEFINED DATA TYPES IN SQL SERVER

10:30 AM - By azeheruddin khan 0

This post demonstrate how to create own user-defined data types in MS SQL Server.

-- Create a birthday data type that allows nulls.

EXEC sp_addtype birthday, datetime, 'NULL'
GO

-- Create a table using the new data type.

CREATE TABLE student
(
   st_id         char(5),
   st_first_name   char(30),
   st_last_name   char(40),
   st_birthday      birthday
)

Tags:
About the Author

I am Azeheruddin Khan having more than 6 year experience in c#, Asp.net and ms sql.My work comprise of medium and enterprise level projects using asp.net and other Microsoft .net technologies. Please feel free to contact me for any queries via posting comments on my blog,i will try to reply as early as possible. Follow me @fresher2programmer
View all posts by admin →

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

adsense

© 2014 Fresher2Programmer. WP Theme-junkie converted by Bloggertheme9
Powered by Blogger.
back to top