Hello All,
I want to implement an address field in a table. But,
this address field is a multi-valued attribute. Also, I want to make it
as a composite field(so that all the info viz, city,st,zip,tel,email
etc can be tied together)
Can anyone tell me how to implement this using T-SQL?I sounds as though you want to store the entire address in a single
table column. You COULD just use a long string, say varchar(255) for
example, but do that and you will never be able to query any of the
individual parts without driving yourself mad in the process. Do you
really want to give up being able to ask for just the addresses in
California? Or just the phone numbers in a specific area code?
The proper way to do this in a database is with multiple columns. One
(two is better) for street address, one for city, one for state, one
for zip, one for phone, one for email. If you need to string them
together that is easy to do when you retrieve them.
Roy Harvey
Beacon Falls, CT
On 3 Mar 2006 10:45:35 -0800, "juventus" <saurabh.kotkar@.gmail.com>
wrote:
>Hello All,
> I want to implement an address field in a table. But,
>this address field is a multi-valued attribute. Also, I want to make it
>as a composite field(so that all the info viz, city,st,zip,tel,email
>etc can be tied together)
>Can anyone tell me how to implement this using T-SQL?
No comments:
Post a Comment