Good Morning.I am writing a backup script and getting the following error message:Msg 137, Level 15, State 2, Line 7Must declare the scalar variable "@ arquivo_DIF."It is a script to restore FULL and Differential Backups.If run the backups work separately, but the script is giving this error.code position below:Declare @pasta char(3), @arquivo_FULL varchar(255), @arquivo_DIF varchar(255), @caminho varchar(255)set @pasta = case datepart( dw, getdate() ) when '1' then 'Dom' when '2' then 'Seg' when '3' then 'Ter' when '4' then 'Qua' when '5' then 'Qui' when '6' then 'Sex' when '7' then 'Sab' endset @caminho = 'T:\Backup\' + @pasta + '\'set @arquivo_FULL = @caminho + 'bkpFULL_'+ 'db1' + '_' + @pasta + '_00_00.BAK'set @arquivo_DIF = @caminho + 'bkpDIF_' + 'db1' + '_' + @pasta + '_06_01.BAK'use masterRESTORE DATABASE [db1_teste]FROM DISK = @arquivo_FULLWITH STATS = 5, FILE = 1, MOVE N'DB1_Novo_Data' TO N'D:\Dados\DB1_Teste.MDF', MOVE N'DB1_Novo_Log' TO N'L:\Log\DB1_Teste.LDF', NORECOVERY, NOUNLOAD, REPLACEGO/* - Restaurando o Diferencial */use masterRESTORE DATABASE [DB1_Teste]FROM DISK = @arquivo_DIFWITH STATS = 3, FILE = 1, MOVE N'DB1_Novo_Data' TO N'D:\Dados\DB1_Teste.MDF',MOVE N'DB1_Novo_Log' TO N'L:\Log\DB1_Teste.LDF',NORECOVERYGORESTORE DATABASE DB1_Teste WITH RECOVERYGO
If anyone has a good tip thanks