Activity overview
Latest activity by NigelC
Hi Jon, You are correct, it is the INSERT that fails BUT, the previous statement creates the table: SELECT TOP(0) * INTO tmp_LatestTRCPHCEvolution FROM Sum_LatestTRCPHCEvolution; ... so after this is executed, the table exists. This really is a defect in the Invalid Object checker. The SQL Compiler is fine with the code; it is just the Invalid Object checker that is not accepting that the code is correct ...
/ comments
Hi Jon,You are correct, it is the INSERT that fails BUT, the previous statement creates the table:SELECT TOP(0)*INTO tmp_LatestTRCPHCEvolutionFROM Sum_LatestTRCPHCEvolution;... so after this is exe...
Hi Jon, I have upgraded to the latest version; no change unfortunately. The following is a cut-down version of the proc that erroneously reports an Invalid Object: USE Operations; GO CREATE OR ALTER PROCEDURE dbo.uSP_Update_Sum_LatestTRCPHCEvolutionTest AS BEGIN IF OBJECT_ID('tmp_LatestTRCPHCEvolution', 'U') IS NOT NULL DROP TABLE tmp_LatestTRCPHCEvolution; SELECT TOP(0) * INTO tmp_LatestTRCPHCEvolution FROM Sum_LatestTRCPHCEvolution; INSERT tmp_LatestTRCPHCEvolution(Year) SELECT 2021; END; The message is: Invalid object name 'tmp_LatestTRCPHCEvolution' The log snippet is: 2021-10-07 10:07:58.376 +01:00 [Information] Checking validity of dbo.uSP_Update_Sum_LatestTRCPHCEvolutionTest of type "StoredProcedure"
2021-10-07 10:07:58.954 +01:00 [Information] Checking validity of dbo.uSP_Update_Sum_LatestTRCPHCEvolutionTest of type "StoredProcedure"
2021-10-07 10:07:58.954 +01:00 [Debug] Script to run is "EXEC [dbo].[uSP_Update_Sum_LatestTRCPHCEvolutionTest]"
2021-10-07 10:07:59.012 +01:00 [Information] Found error: Invalid object name 'tmp_LatestTRCPHCEvolution'.
[image] [image]
/ comments
Hi Jon, I have upgraded to the latest version; no change unfortunately.The following is a cut-down version of the proc that erroneously reports an Invalid Object:USE Operations;GOCREATE OR ALTER PR...