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 |
reliabox-mike
Starting Member
1 Post |
Posted - 2011-06-20 : 22:12:09
|
Is there a standard for naming the columns of a table? A coworker and I are going back and forth on appending the full table name to the column or not. example table - widgetcolumn - widget_nameor column - namewhat one is better?Windows Hyper-V VPS at Reliabox.com |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
BaggaDonuts
Yak Posting Veteran
52 Posts |
Posted - 2011-06-29 : 03:50:00
|
Here's what I do:Table names: Use Pascal Casing. Make the table name singular. Ex: Product, ProductAttribute. Don't do things like prefix it with "t_". When integrating with something like Entity Framework, your object would then be called a "t_Product". Singular table names are also very beneficial when using Entity Framework. So using my standard, the EF object would be named "Product." Nice to keep it consistent across layers.Table Columns: Use Pascal Casing. For your primary key column I prefer to have the table name followed by "Id." If you have a human readable identifier as well, I call those the table name followed by "Name." So, for the Product table example, some columns might be: ProductId, ProductName, ReleaseDate. |
|
|
khan_shahidnoor
Starting Member
2 Posts |
Posted - 2011-07-13 : 03:12:32
|
how update tabe from another table |
|
|
khan_shahidnoor
Starting Member
2 Posts |
Posted - 2011-07-13 : 03:13:37
|
how to update table from another table in sql server 2005 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jcelko
Esteemed SQL Purist
547 Posts |
Posted - 2011-07-16 : 11:25:45
|
Yes. ISO-11179 Meta Data Standards. For a readable explanation get a copy of my SQL PROGRAMMING STYLE. I also included the results of research that AIRMICS did for the DoD. The basic idea is to name a data element for what it is by its nature and name it completely. DO NOT name it by where it is or how it is used in one place. They are global in the whole schema, and better yet universal (UPC, ISBN, VIN, etc). The general format is: [<role>_]<attribute>_<attribute property>So we write "widget_name", "widget_size", etc. and perhaps when many column are drawn from the widget domain, "primary_widget_name", "secondary_widget_name" and so forth. We never use PascalCase or camelCase as they are physically harder to read (your eyes jump to upper case letter). Some companies and US government now require the ISO-11179 Standards and are building data dictionaries, etc. for it. --CELKO--Books in Celko Series for Morgan-Kaufmann PublishingAnalytics and OLAP in SQLData and Databases: Concepts in Practice Data, Measurements and Standards in SQLSQL for SmartiesSQL Programming Style SQL Puzzles and Answers Thinking in SetsTrees and Hierarchies in SQL |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-07-19 : 00:09:56
|
^^ More spam ^^ |
|
|
|
|
|
|
|