Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Hungarian notation convention
59 posts, Page 1 of 6
1
2
3
4
5
»
»»
Hungarian notation convention
Rate Topic
Display Mode
Topic Options
Author
Message
NicHopper
NicHopper
Posted Wednesday, September 10, 2008 6:58 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:31 AM
Points: 1,308,
Visits: 1,422
Hi everyone,
Does anyone know where I can find a list of SQL data types and their Hungarian notation convention prefixes?
I can find them for VB but not for SQL Server.
Thanks,
Jackal.
------------------------------------------------------------
Check out
my blog
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #566838
GSquared
GSquared
Posted Wednesday, September 10, 2008 7:09 AM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:55 PM
Points: 15,442,
Visits: 9,571
I don't think there's a standard reference.
What I've seen, when I've seen it, has been:
int
tint
sint
bint
dtm
sdtm
vc
nvc
char
nchar
dec
num
flt
I don't use these, but they're what I've seen someone else use.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #566849
NicHopper
NicHopper
Posted Wednesday, September 10, 2008 7:12 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:31 AM
Points: 1,308,
Visits: 1,422
Thanks GSquared.
I've been looking all morning, with no joy.
These should do me.
Thanks again.
------------------------------------------------------------
Check out
my blog
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #566853
GSquared
GSquared
Posted Wednesday, September 10, 2008 12:29 PM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:55 PM
Points: 15,442,
Visits: 9,571
You're welcome.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #567202
Jeff Moden
Jeff Moden
Posted Monday, September 22, 2008 8:06 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 2:32 PM
Points: 32,906,
Visits: 26,792
Gosh... you can use Hungarian notation if you want, but I think it's a real PITA. Let's say you have a table called something like tbl_MyTable. Someone redesigns a part of the system and the powers that be decide to use an indexed view instead of a table... and you have hundreds of stored procedures and GUI code instances where the code says "tbl_MyTable". Now what? You have 3 choices... find and change ALL the SQL Server and GUI code to the name of the new view, have a view with the "tbl_" prefix, or have a synonym (or passthrough view) named after a table even though it's a view.
My recommendation is to never use Hungarian notation in SQL Server. It's just not needed and can be a real PITA if certain changes are required. :)
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #573989
NicHopper
NicHopper
Posted Tuesday, September 23, 2008 1:48 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:31 AM
Points: 1,308,
Visits: 1,422
Hi Jeff,
Thanks for the reply, I am in complete agreeance with you. I've just been tasked with investigating it's usage potential.
Jackal
------------------------------------------------------------
Check out
my blog
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #574096
Jeff Moden
Jeff Moden
Posted Tuesday, September 23, 2008 7:41 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 2:32 PM
Points: 32,906,
Visits: 26,792
Heh... include my post in your report on usage potential advising against using it.
The only time I even come close to Hungarian notation is that I'll use a "pi" or "po" prefix on parameters in long stored procedures just to make the parameters easier to identify on long procs.... but I darned sure won't prefix one with something like "i" or "int" because even variables and parameters can change requirements of time. Imagine having a bunch of GUI or T-SQL that passes named parameters to a proc and ultimately ending up thinking something was other than an Int because even though the data type for the variable changed, you couldn't change the name of the parameter for fear of breaking GUI code that did use named parameters.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #574852
Jim Russell-390299
Jim Russell-390299
Posted Wednesday, September 24, 2008 5:44 AM
SSC-Addicted
Group: General Forum Members
Last Login: Friday, July 30, 2010 11:27 AM
Points: 435,
Visits: 1,403
Just don't do it! As usual, Jeff is right. (And it is one of the worst ideas MS ever came up with.)
Post #575083
MVDBA
MVDBA
Posted Wednesday, September 24, 2008 7:34 AM
SSCrazy
Group: General Forum Members
Last Login: Monday, April 29, 2013 10:15 AM
Points: 2,261,
Visits: 758
Agree Completely..
not just tables and views though - I've inherited a Database written by a .Net developer and all my columns have prefixes and suffixes
for example
Mytable_Mycolumns_tinyint
if i want to upgrade tinyint to int then my (inherited) app becomes a mess.... or i have to recode and recompile..
even worse it's not really readable - given that you may know that table customer has an age field
select max(tintage) from customer
is not really great!!! even worse you have to know the data type before you can query the column
one thing i can recommend though is try and use the Singular of Table and column names
i.e
Customer rather than customers
Hobby rather than Hobbies
yes the table is a collection of customer, but this can be easily confusing since apostrophee cannot be used in table names
customershobbies could referernce all customers' hobbies or a single customer's hobbies
instead stick to customerhobby
MVDBA
Post #575185
Jeff Moden
Jeff Moden
Posted Wednesday, September 24, 2008 6:05 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 2:32 PM
Points: 32,906,
Visits: 26,792
Holy Moly, Mike... I thought I had it bad and the current job...
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #575658
« Prev Topic
|
Next Topic »
59 posts, Page 1 of 6
1
2
3
4
5
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.