Sometimes this is the only way. If you need to do this, DOCUMENT, DOCUMENT, DOCUMENT facts. Here is one way to make this clear: put the table definition in a comment in the options section ...
CREATE PROCEDURE xyz ( @param1 int --REQUIRED, what it does ,@param2 char(1) --OPTIONAL, what it does ,@param3 varchar(25) --OPTIONAL, what it does --this temp table is required and must be created in the calling procedure --#TempXyz (RowID int not null primary key -- ,DataValue varchar(10) not null -- ,DateValue datetime null -- ) )
Also the document in the calling procedure where the temp table is created ....
--** THIS TEMP TABLE IS PASSED BETWEEN STORED PROCEDURES ** --** ALL CHANGES MUST TAKE THIS INTO CONSIDERATION!!! ** CREATE TABLE #TempXyz (RowID int not null primary key ,DataValue varchar(10) not null ,DateValue datetime null )
source share