Max database name length in SQL Server

前端 未结 2 1991
时光取名叫无心
时光取名叫无心 2021-01-07 22:05

I am trying to do some UI validation on a database name. I was told from different places that the SQL Server database name is stored as sysname inside SQL Server. I also ve

2条回答
  •  滥情空心
    2021-01-07 22:28

    Are you not running into the problem of the file names for the data and log files. The underlying operating system (Windows) places restrictions on it and therefore the database cannot be created. The database name may be 128 characters long and works given that the file names used are not being to long (when using the SQL Server Management Studio it automatically generates file names based on the database names, and they therefore end up being long).

提交回复
热议问题