I have three queries that put data in their respective #temp tables. Later, In one query those #temp tables are used again to get the data.
i.e
select {some columns} into #temp1 from {some tables} where {conditions1}
select {some other columns} into #temp2 from {some tables} where {conditions2}
select {some other columns} into #temp3 from {some tables} where {conditions3}
select {some columns from all #temp tables} from #temp1, #temp2, #temp3 where {conditions}
I want to get rid of these #temp tables and want to run last query without those #temp tables.
Any thought!!!
How about writing three different functions and putting all three query in those functions and calling functions from the third query!!
Thanks
Jai
See Question&Answers more detail:os