Solution i found:-
I was checking the table in temporary database with table name which was creating ambiguity as the table might be created in a different session so i changed the query to
SET @DQuery = 'IF NOT EXISTS (SELECT col.name FROM tempdb.sys.objects obj INNER JOIN tempdb.sys.columns col ON obj.object_id = col.object_id WHERE col.name = ''child_FG'+ CAST(@INTCOUNT AS VARCHAR) +'''
AND OBJECT_ID(''tempdb..#tdata'') = obj.object_id)'
<pre lang="SQL">
and it solved my problem as the object id for any table (temporary or physical) will be unique.
Thanks for your time friends.