Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Naunihal writes "How can i create Complex UserLike Person, Having Follwong sub type FirstName LastName DateOfBirth etc....Somethhing that we can easily do in Programming Languages like structureALso 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 dateofbirthfrom usertable
<O>
VyasKN
SQL Server MVP & 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,VyasCheck out my SQL Server site @http://vyaskn.tripod.com