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.
Author |
Topic |
KernDo
Starting Member
2 Posts |
Posted - 2009-10-20 : 11:40:08
|
Can someone tell what is the datatype "tid" in SQL Server referring to? I'm seeing this from the table "sales" of the "pubs" sample database. In addition, I do not know why there are brackets surounding each column, for example, [stor_id]. I could not use the below statement to recreate the table -- It seemed to be ok if I took out those "brackets" but then I hit the "tid" and it failed.Thanks in advance.Kern --kern_doe@yahoo.comCREATE TABLE [dbo].[sales] ( [stor_id] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ord_num] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ord_date] [datetime] NOT NULL , [qty] [smallint] NOT NULL , [payterms] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [title_id] [tid] NOT NULL ) ON [PRIMARY]GO |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2009-10-20 : 13:30:20
|
tid must be a user-defined data type. The brackets are there in case the objects are reserved words or have special characters in them such as a space. You should not get an error with the brackets in the script, so if you are getting an error it makes me wonder what client tool you are using.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog"Let's begin with the premise that everything you've done up until this point is wrong." |
 |
|
KernDo
Starting Member
2 Posts |
Posted - 2009-10-20 : 14:41:53
|
Everything you've said is correct. I did check with a colleague, he said the same thing. User defined datatypes, I guess, is specific to SQL Server which is different from ... Informix -- As far as for syntax, same thing goes for "Bracket". No, I think I may have reported wrong error, it did not fail for brackets, but for "tid" since I took this sql to create an empty "sales" table in another database.Thanks so much TKizer. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
yakintayo
Starting Member
1 Post |
Posted - 2009-11-03 : 09:36:44
|
how can i rectify the 'tid' errorAO |
 |
|
Bill_C
Constraint Violating Yak Guru
299 Posts |
Posted - 2009-11-03 : 09:54:13
|
try creating the same datatype in your database |
 |
|
|
|
|
|
|