Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Complex User Defined Data Type

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-26 : 11:05:11
Naunihal writes "How can i create Complex User

Like Person,
Having Follwong sub type
FirstName
LastName
DateOfBirth
etc....

Somethhing that we can easily do in Programming Languages like structure

ALso i would like to know how can i Use these data type to store & retrive value into table Using SQL queries & From FRont End like VB(ADO)

Thanks"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-04-26 : 11:27:14
you don't need a user-defined datatype, you need a table something like

create table usertable (
personid int identity(1,1) not null constraint pk_usertable primary key,
firstname varchar(50) null,
lastname varchar(50) null,
dob smalldatetime null
)

 
then you would...

select
firstname,
lastname,
dbo as dateofbirth
from
usertable

 


<O>
Go to Top of Page

VyasKN
SQL Server MVP &amp; SQLTeam MVY

313 Posts

Posted - 2002-04-26 : 11:49:17
In addition to the other response, you can also use table variables in your stored procedures and functions in SQL Server 2000

--
HTH,
Vyas
Check out my SQL Server site @
http://vyaskn.tripod.com
Go to Top of Page
   

- Advertisement -