文件名称:sqlserver数据库移动数据库路径的脚本示例
文件大小:32KB
文件格式:PDF
更新时间:2024-01-04 21:40:36
ls lse SQL
代码如下:USE masterGO DECLARE @DBName sysname, @DestPath varchar(256)DECLARE @DB table( name sysname, physical_name sysname) BEGIN TRY SELECT @DBName = ‘TargetDatabaseName’, –input database name @DestPath = ‘D:\SqlData\’ –input destination path — kill database processesDECLAR