I have multiple stored proc where it is required to grab the name of the incoming file and write that to a separate table.
A few of those proc do this three times and it gets accomplished by creating a tmp table.
Is there a better way to handle this?
CREATE TABLE #TmpReturnedFileID1 (FileID integer)
EXECUTE dbo.ap_CreateFileLog 'Online - RBHAREFM'
SELECT @FileID = FileID FROM #TmpReturnedFileID1
DROP TABLE #TmpReturnedFileID1
dbo.ap_CreateFileLog call 3 times within another proc.