SQL Server: Maximum character length of object names

前端 未结 3 1271
南笙
南笙 2020-12-07 21:20

What is the maximum character length of object name (e.g. constraint, column) in SQL Server 2008?

3条回答
  •  我在风中等你
    2020-12-07 22:19

    Yes, it is 128, except for temp tables, whose names can only be up to 116 character long. It is perfectly explained here.

    And the verification can be easily made with the following script contained in the blog post before:

    DECLARE @i NVARCHAR(800)
    SELECT @i = REPLICATE('A', 116)
    SELECT @i = 'CREATE TABLE #'+@i+'(i int)'
    PRINT @i
    EXEC(@i)
    

提交回复
热议问题