SQL中出错。找不到

时间:2011-01-05 00:46:25

标签: sql-server tsql

SQL中的错误。找不到它。

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 

1 个答案:

答案 0 :(得分:1)

只是预感,请尝试将N'Ежечастный лог транкзаций'更改为'NORMAL STRING'