November 17, 2006 at 6:35 am
Hi
Stored Proc A creates #temp_data and then calls Stored Proc B.
How can SP B check what column names are in #temp_data ?
I thought of looking at syscolumns and sysobjects but the table I'm looking for looks something like this : "#temp_data________________0000123456". Which would mean I'd have to do a wildcard search.
How do I know that its the # table that was created during this session, and not a different table ?
If there's 2 #temp_data tables in sysobjects i'm going to get unexpected results.
1. How can I know that the '__0000123456' is from my session.
or
2. Is there another way to test for the existence of the column names I'm looking for ?
Thanks in advance,
Jason
November 17, 2006 at 7:00 am
Just pass the column names in parameter. I mean you must know 'em somehow since you create the temp table??.
Also you can get the objectid using object_id('tempdb..#ShortTableNameWithoutGarbageCharactersToIdentifyItFromOneSessionToTheOther')
That way you can search tempdb.dbo.syscolumns using the ID.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply