I'm trying to create a database table whose primary key comes from the pubs
database, titles table. The column name from the titles table is title_id.
Its data type is tid. What is tid? Example: BU1032
See the pubs documentation at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_pubs
_2v8l.asp
Andrew J. Kelly - 03 Jul 2005 01:21 GMT
It is a User Defined Datatype with the underlying real datatype of
VARCHAR(6). You can find more info about UDT's in BooksOnLine but
essentially it is a way to define a datatype in one place that you can then
use in many tables and they will inherit the underlying datatype. It's main
purpose is to make sure the datatypes are all defined the exact same way in
each table where it is used. Sounds good in theory but if you need to make
a change you must drop it from all the tables where it is being used first.
I never recommend them for that reason alone.

Signature
Andrew J. Kelly SQL MVP
> I'm trying to create a database table whose primary key comes from the
> pubs
[quoted text clipped - 3 lines]
> See the pubs documentation at:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_pubs
_2v8l.asp
Kalen Delaney - 03 Jul 2005 17:25 GMT
And to add to Andy's comments, you can see the definition of any UDT with
sp_help:
EXEC sp_help tid

Signature
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
> I'm trying to create a database table whose primary key comes from the
> pubs
[quoted text clipped - 3 lines]
> See the pubs documentation at:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_pubs
_2v8l.asp