SQL脚本获取SQLServer数据库目录存储过程:f_GetDBPath
作者:C/S框架网|www.cscode.ne 发布日期:2021/02/07 16:20:26
SQL脚本获取SQLServer数据库目录存储过程:f_GetDBPathSQL Code:alter function f_GetDBPath(@dbname varchar(100))
returns varchar(1000)
as
begin
/****************************************************
获取数据库目录
select dbo.f_GetDBPath('master')
*****************************************************/
declare @path varchar(1000)
select @path=rtrim(filename) from master..sysfiles where name='master'
return replace(@path,@dbname+'.mdf','')
end;
//来源:C/S框架网 | www.csframework.com | QQ:23404761