Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell', 1;
go
RECONFIGURE;
GO
CREATE DATABASE [demo_rename]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'demo_rename', FILENAME = N'C:\sql_server_data\MSSQL12.SQL2014\MSSQL\DATA\demo_rename.mdf' , SIZE = 5120KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'demo_rename_log', FILENAME = N'C:\sql_server_data\MSSQL12.SQL2014\MSSQL\DATA\demo_rename_log.ldf' , SIZE = 2048KB , FILEGROWTH = 10%)
GO
ALTER DATABASE [demo_rename] SET MULTI_USER
GO
select name, mf.physical_name
from sys.master_files mf
where db_name(mf.database_id) = 'demo_rename'
alter database demo_rename set single_user with rollback immediate
alter database demo_rename set offline
alter database demo_rename modify file (name=N'demo_rename', filename=N'C:\sql_server_data\MSSQL12.SQL2014\MSSQL\DATA\demo_newname.mdf')
exec sys.xp_cmdshell 'move C:\sql_server_data\MSSQL12.SQL2014\MSSQL\DATA\demo_rename.mdf C:\sql_server_data\MSSQL12.SQL2014\MSSQL\DATA\demo_newname.mdf'
alter database demo_rename set online
select name, mf.physical_name
from sys.master_files mf
where db_name(mf.database_id) = 'demo_rename'
EXEC sp_configure 'xp_cmdshell', 0;
go
RECONFIGURE;
GO
drop database demo_rename