开发者

Error in SQL. Can not find it

开发者 https://www.devze.com 2023-02-02 18:30 出处:网络
Error in SQL. Can not find it. DECLARE @year VARCHAR (4), @month VARCHAR (2), @day VARCHAR (2), @weekday VARCHAR (2),

Error in SQL. Can not find it.

DECLARE @year VARCHAR (4),
    @month VARCHAR (2),
    @day VARCHAR (2),
    @weekday VARCHAR (2),
    @hour VARCHAR (2),
    @archivePath VARCHAR (128),
    @archiveName VARCHAR (128),
    @archiveFullName VARCHAR (128)


SET @year = CAST(DATEPART(yyyy, GETDATE()) AS VARCHAR) 
SET @month = CAST(DATEPART(mm, GETDATE()) AS VARCHAR) 
SET @day = CAST(DATEPART(dd, GETDATE()) AS VARCHAR) 
SET @weekday = CAST(DATEPART (dw, GETDATE()) AS VARCHAR) 
SET @hour = CAST(DATEPART (hh, GETDATE()) AS VARCHAR)
SET @archivePath = 'd:\1c_new\backupdb\'
SET @archiveName = 'TransactionLog_' + @year + '_' + @month + '_' + @day + '_' + @hour + '.bak'
SET @archiveFullName = @archivePath +  @archiveName

BACKUP LOG [xxx] TO  DISK = @archiveFullName WITH  INIT ,  NOUNLOAD , NAME = N'Ежечастный лог транкзаций',  SKIP ,  STATS =开发者_如何学编程 10,  DESCRIPTION = N'Ежечастный лог транкзаций',  NOFORMAT 


Just a hunch, try changing N'Ежечастный лог транкзаций' to something like 'NORMAL STRING'

0

精彩评论

暂无评论...
验证码 换一张
取 消