Why Does Updating A Real Table From A Self-join Temp Table Is Not Working But When Using A Real Table It Works?
Here's the scenario: Procedure 1 creates temp table #t. Procedure 1 executes procedure 2. Procedure 2 populates #t. In procedure 1, I insert into a real table from #t just so I can
Solution 1:
Per the MS SQL Docs:
A local temporary table created in a stored procedure is dropped automatically when the stored procedure is finished. The table can be referenced by any nested stored procedures executed by the stored procedure that created the table. The table cannot be referenced by the process that called the stored procedure that created the table.
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-2017
Post a Comment for "Why Does Updating A Real Table From A Self-join Temp Table Is Not Working But When Using A Real Table It Works?"