 |
操作系统:win2000 winnt4.0
编程工具:sql
问题:if exists (select * from sysobjects where id = object_id('dbo.sp_gc_backup_for_monday') and sysstat & 0xf = 4)
drop procedure dbo.sp_gc_backup_for_monday
GO
CREATE PROCEDURE sp_gc_backup_for_monday AS
----清不活动日志
dump transaction GoodsContract to diskdump with truncate_only
----取卷标为 'g0' + 年份 + 星期 , 如 g00212 : 2002年第12星期
declare @volumestr char(6)
select @volumestr ='g0' + right(CONVERT(varchar(4),datepart(year,getdate())),2)
+ right('0'+ CONVERT(varchar(2),datepart(week,getdate()) ),2)
----备份数据库
dump database GoodsContract to GoodsContractBackUp volume = @volumestr with init
GO
在sql605上语法检查通过,在sql2000上说在select @volumestr ='g0' + right(CONVERT(varchar(4),datepart(year,getdate())),2) 有语法错误,请问怎么解决?
水平: 刚入门(孙金荣)
|
| |
|
 |
沈钦仙的意见:
将dump database GoodsContract to GoodsContractBackUp volume = @volumestr with init 改成
dump database GoodsContract to GoodsContractBackUp with init ,medianame= @volumestr 即可。
此问题由沈钦仙
回答。
附加关键字:编程, 源程序, programming, source code, 其他语言, asm, vba, vbscript, SQL查询, sql server, sql, query, select。
|
| |
|
| |
|
| |
|
|