SQL Server Maximum Character Length- Table and Field Names

MSingh
3StarLounger
Posts: 366
Joined: 12 May 2010, 06:49

SQL Server Maximum Character Length- Table and Field Names

Post by MSingh »

Hi,

I'm seeking confirmation on the following 2 points (I trust the advices from Eileen's Lounge over google searches):

1. The maximum number of characters in a table name in SQL Server is 128.

2. The maximum number of characters in a field name in SQL Server is 128.

Would these limitations apply to all versions of SQL Server from 2008 onwards ie. SQL Server 2008 Express + ?

Your advices are appreciated.

Kind Regards,
Mohamed

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SQL Server Maximum Character Length- Table and Field Nam

Post by HansV »

According to Microsoft, the following applies to all versions of SQL Server from SQLServer 2008 through the current version (SQL Server 2014):
table_name can be a maximum of 128 characters
Source: CREATE TABLE (SQL Server)
column_name can be a maximum of 128 characters
Source: ALTER TABLE (Transact-SQL)
Best wishes,
Hans

MSingh
3StarLounger
Posts: 366
Joined: 12 May 2010, 06:49

Re: SQL Server Maximum Character Length- Table and Field Nam

Post by MSingh »

Thank You Hans.
Kind Regards,
Mohamed