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
 General SQL Server Forums
 New to SQL Server Administration
 datatype tid?whatisit? bracket surn'ding a column?

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.com


CREATE 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 Kizer
Microsoft MVP for Windows Server System - SQL Server
http://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."
Go to Top of Page

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.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-10-20 : 15:18:31
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://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."
Go to Top of Page

yakintayo
Starting Member

1 Post

Posted - 2009-11-03 : 09:36:44
how can i rectify the 'tid' error

AO
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2009-11-03 : 09:54:13
try creating the same datatype in your database
Go to Top of Page
   

- Advertisement -