Can someone quickly explain to me (as in without directing me to an illegible mountain of documentation) what a construct such as this (below) means in a SQL Server stored procedure?
Note, this is in a stored procedure on a database which resides on a server with many other databases and this is a generalization not the exact query
INSERT INTO [schema].TableName (Field1, Field2)
SELECT
OtherField1,
OtherField2
FROM
#Something TMP
INNER JOIN
[schema].[Field] A ON A.Whatever = TMP.Whatever;
Note: I've been using MySQL and Postgres for years so understand the basics, but this SQL Server has a lot of features that are new to me. What I can tell here is that we are filling a table with the results from another table (or something) and that is what I want to know. What is the or something? In this example, what does #Something
actually reference?
I am aware of linked servers, but I don't see one in this system with the name referenced. And I also don't see any definition in this stored procedure of what #Something
references.
One thought I had was that perhaps a stored procedure can use another stored procedure and in that way perhaps this #Something
is defined in the calling procedure? Is this even possible?