LessThanDot Site Logo

LessThanDot

A Technical Community for IT Professionals

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Highly Rated Users

Forum
No Posts Rated

Top 50
Given
Received

Links

Wiki
Blog

Forum Statistics

Users
Members:
1879
Members Online:
1
Guests Online:
91

Total Post History
Posts:
81451
Topics:
18716

7-Day Post History
New Posts:
0
New Topics:
0
Active Topics:
0

Our newest member
mwojcik

Other

FAQ
All times are UTC [ DST ]

Ident Data Type?

Microsoft SQL Server
Please wait...

Ident Data Type?

Postby Chopstik on Thu Sep 19, 2013 8:29 pm

Ok, this is new to me as I've never come across it before and didn't really see anything in my initial Google search (though I persist in looking for more on it). When I run the following query on our server:

  1. select distinct name from systypes


I get a data type of "Ident" for one of them (along with others with which I'm also unfamiliar). Normally I wouldn't stress about it but I see elsewhere queries that declare variables as Ident fields and I started to change them before someone told me that they actually work. I'm thinking that someone has done some funky stuff to the db to set them up to work in the fashion but figured I'd ask here and see if someone has come across this in the standard product somewhere and I just have never seen it previously. Thanks.
Reason and free inquiry are the only effectual agents against error; they are the natural enemies of error and of error only.

Thomas Jefferson

WAR IS PEACE • FREEDOM IS SLAVERY • IGNORANCE IS STRENGTH

Winston Smith
User avatar
Chopstik
LTD Admin
LTD Admin
LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346
LTD Silver - Rating: 346
 
Posts: 4316
Joined: Thu Oct 11, 2007 2:04 pm
Unrated

Re: Ident Data Type?

Postby gmmastros on Thu Sep 19, 2013 8:47 pm

Can you check to see if this is a user defined data type?

Open SQL Server Management Studio, expand your database, then Programmability -> Types -> User-Defined Data Types.
-George
User avatar
gmmastros
LTD Admin
LTD Admin
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630
 
Posts: 2369
Joined: Tue Oct 09, 2007 5:19 pm

Re: Ident Data Type?

Postby Chopstik on Thu Sep 19, 2013 9:10 pm

Yep, that was it. I hadn't encountered this previously and now I have something new to go look up. Not to mention figure out why we would want to do this instead of something that makes more sense (like using the already established data types)... Thanks, George!
Reason and free inquiry are the only effectual agents against error; they are the natural enemies of error and of error only.

Thomas Jefferson

WAR IS PEACE • FREEDOM IS SLAVERY • IGNORANCE IS STRENGTH

Winston Smith
User avatar
Chopstik
LTD Admin
LTD Admin
LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346LTD Silver - Rating: 346
LTD Silver - Rating: 346
 
Posts: 4316
Joined: Thu Oct 11, 2007 2:04 pm
Unrated

Re: Ident Data Type?

Postby Remou on Thu Sep 19, 2013 9:12 pm

Very interesting.
Stop quoting laws to us. We carry swords.
User avatar
Remou
LTD Admin
LTD Admin
LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971
LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971LTD Gold - Rating: 971
LTD Gold - Rating: 971
 
Posts: 5414
Joined: Sun Oct 14, 2007 11:26 am
Unrated

Re: Ident Data Type?

Postby gmmastros on Thu Sep 19, 2013 10:37 pm

I never use "user defined data types". However, the justification for it is that you would get a consistent data type anywhere it is needed. For example, suppose you have a PhoneNumber data type. You might initially set this as varchar(10) because it accommodates US phone numbers. Later, you might decide that you want to accommodate international phone numbers that are a little longer... and then you think... what about phone extensions, should we accommodate 3 digits for the extension, or should it be more.

When you have columns in tables that have the PhoneNumber data type, you can easily see where they are and make the appropriate changes.

Like I said, I don't use them but I can see where they might be useful on occasion.
-George
User avatar
gmmastros
LTD Admin
LTD Admin
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630
 
Posts: 2369
Joined: Tue Oct 09, 2007 5:19 pm

Re: Ident Data Type?

Postby gmmastros on Thu Sep 19, 2013 10:39 pm

I should also mention that you cannot change user defined data types. If you ever needed to change it, you would have a relatively hard time doing it.
-George
User avatar
gmmastros
LTD Admin
LTD Admin
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630LTD Gold - Rating: 1630
LTD Gold - Rating: 1630LTD Gold - Rating: 1630
 
Posts: 2369
Joined: Tue Oct 09, 2007 5:19 pm
Unrated

Re: Ident Data Type?

Postby SQLDenis on Fri Sep 20, 2013 4:40 pm

I don't really use user defined data types because it can cause confusion and it is also not immediately clear what the underlying data type is

That said I worked at a shop once where SSN was a user defined data type, it was char(11) and it included the dashes as well IIRC

Of course a normal person these days would never store that unencrypted but that is another story
User avatar
SQLDenis
LTD Admin
LTD Admin
LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467
LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467
LTD Gold - Rating: 3467LTD Gold - Rating: 3467LTD Gold - Rating: 3467
 
Posts: 21784
Joined: Wed Oct 10, 2007 6:43 pm
Location: Princeton, New Jersey, USA,World, Solar System, Milky Way, Universe and Beyond
Unrated

Re: Ident Data Type?

Postby alice22 on Fri Sep 05, 2014 12:40 pm

I eventually tested, and it seemed to work okay. I even ended up with what I wanted in the updated fields. I was worrying if it was a bad idea to use these kinds of triggers.



solitairecardgame cards games online patience klondike
alice22
Newbie
Newbie
 
Posts: 1
Joined: Fri Sep 05, 2014 12:39 pm
Unrated