Renaming the Physical Filename for Datafiles in SQL Server 2008
2011-09-27 12:06
507 查看
using T SQL
ALTER DATABASE databaseName SET OFFLINE
GO
ALTER DATABASE databaseNAme MODIFY FILE (NAME =db, FILENAME = 'C:\Program
Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db.mdf')
GO--if changing log file name
ALTER DATABASE databaseNAme MODIFY FILE (NAME = db_log, FILENAME =
'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db.ldf')
GO
ALTER DATABASE databaseName SET ONLINE
GO
ALTER DATABASE databaseName SET OFFLINE
GO
ALTER DATABASE databaseNAme MODIFY FILE (NAME =db, FILENAME = 'C:\Program
Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db.mdf')
GO--if changing log file name
ALTER DATABASE databaseNAme MODIFY FILE (NAME = db_log, FILENAME =
'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db.ldf')
GO
ALTER DATABASE databaseName SET ONLINE
GO
相关文章推荐
- Could not store transport type data for Receive Location 'Recv.Loc' to config store. Primary SSO Server 'Sql-server' failed. The external credentials in the SSO database are more recent.
- Using the TIME data type in SQL Server 2008
- Microsoft SQL Server 2008 R2 XML处理 One solution is to increase the number of characters retrieved from the server for XML data.
- sql express 2008 - Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instan
- SQL Server error "Xml data type is not supported in distributed queries" and workaround for it
- SQL Server 2008安装报错:The specified credentials for the sql server service are not valid
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection
- DB太大?一键帮你收缩所有DB文件大小(Shrink Files for All Databases in SQL Server)
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance
- Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies 读书笔记之六
- Top 10 steps to optimize data access in SQL Server: Part V (Optimize database files and apply partitioning)
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection
- DB太大?一键帮你收缩所有DB文件大小(Shrink Files for All Databases in SQL Server)
- ssh开发中插入数据时遇到 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
- ArcGIS for Server 10.1 注册postsql SDE提示the data Item is inaccessible
- [转]UTF-8 encoding support for the BCP utility and BULK INSERT Transact-SQL command in SQL Server 2014 SP2
- Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies 读书笔记之六
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection