Create database using script at the default path?

后端 未结 2 2024
日久生厌
日久生厌 2021-02-01 17:42

I\'ve generated a script of a database in SQL Server 2008. The generated script has the hardcoded path of where the database would be created. I don\'t want this path to be hard

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 18:00

    Simply create the database and then adjust all the needed properties directly in files

    CREATE DATABASE [POS] 
    GO
    ALTER DATABASE POS MODIFY FILE 
    ( NAME = N'POS' , SIZE = 3048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
    GO
    ALTER DATABASE POS MODIFY FILE 
    ( NAME = N'POS_log' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    

提交回复
热议问题