当我在 SQL Server 2008 中使用此语句时:
--INSERT INTO #tmp_file EXEC ('restore_database_proc N''' + @database_bak_path + '''')
INSERT INTO #tmp_file EXEC ('RESTORE FILELISTONLY FROM DISK = N''' + @database_bak_path + '''')
set @database_mdf_oldname = (select LogicalName from #tmp_file where Type = 'D')
set @database_log_oldname = (select LogicalName from #tmp_file where Type = 'L')
调试过程时变量 没有值,所以我想检查临时表是否有值以及为什么结果没有给出变量@database_mdf_oldname
?@database_log_oldname