求一SQL语句 select * from sysdatabases 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --根据安装路径得到默认的备份目录:select @path=rtrim(reverse(filename)) from master..sysfiles where name='master'select @path=substring(@path,charindex('\',@path)+1,8000),@path=reverse(substring(@path,charindex('\',@path),8000))+'BACKUP\'select SQL默认备份目录=@path --得到SQL中的各种目录declare @path varchar(8000)--根据安装路径得到默认的备份目录:select @path=rtrim(reverse(filename)) from master..sysfiles where name='master'select @path=substring(@path,charindex('\',@path)+1,8000),@path=reverse(substring(@path,charindex('\',@path),8000))+'BACKUP\'select SQL默认备份目录=@path select phyname from sysdevices where name='tempdev' 不是这个意思现在我怕程序要做的是为数据库备份与还原,数据库名为NetEdu,现在要检查备份集NetEdu_bac是否已经被创建,如已经存在,则要得得它的备份文件名,如不存在则进行创建并备份该怎么做? 感谢welyngj(平平淡淡) !!!不知道用SQL是否能更改该备份集的目录? 可以先删除,然后再添加。USE mastergosp_dropdevice 'mydiskdump'goEXEC sp_addumpdevice 'disk', 'mydiskdump', 'c:\dump1.bak' 查看记录属于第几行 合并列记录 在 SQL中怎样查询第几行数据? 出错了。!!!!!!!!! 链接服务器 '(null)' 的 OLE DB 访问接口'SQLNCLI' 返回了对列 '[SQLNCLI].字段' 无效的数据。 ADO访问SQL Server2005时连接不了 我的这个存储过程出现“在多语句事务内不允许使用 CREATE DATABASE 语句”这个错误 请教个蛮怪的查询 大家帮忙改变字段范围!!!!!!!!!!!!!!! 服务器端是否必须安装数据库管理系统,众说不一,请各位参与讨论! 如何将下面的varchar转为数据型? 难题!如何实现禁止对列的编辑!
select @path=rtrim(reverse(filename)) from master..sysfiles where name='master'
select @path=substring(@path,charindex('\',@path)+1,8000),
@path=reverse(substring(@path,charindex('\',@path),8000))+'BACKUP\'
select SQL默认备份目录=@path
--得到SQL中的各种目录
declare @path varchar(8000)
--根据安装路径得到默认的备份目录:
select @path=rtrim(reverse(filename)) from master..sysfiles where name='master'
select @path=substring(@path,charindex('\',@path)+1,8000),
@path=reverse(substring(@path,charindex('\',@path),8000))+'BACKUP\'
select SQL默认备份目录=@path
现在我怕程序要做的是为数据库备份与还原,
数据库名为NetEdu,现在要检查备份集NetEdu_bac是否已经被创建,
如已经存在,则要得得它的备份文件名,
如不存在则进行创建并备份
该怎么做?
不知道用SQL是否能更改该备份集的目录?
USE master
go
sp_dropdevice 'mydiskdump'go
EXEC sp_addumpdevice 'disk', 'mydiskdump', 'c:\dump1.bak'