Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

View Question

$
0
0
I am currently running a maketable statement, and then pulling data from my make table. However, I was thinking it would be more efficient to just create a view. However, the snare that I am hitting is that my SELECT statement pulls from 3 tables, 1 of which is a temp table.
Here is my current SELECT statement structure:
Code:

SELECT ID, FirstName, LastName, position, StoreName, StoreNumber
FROM (MasterStoreInfo INNER JOIN #MasterStoreInfo_Helper ON MasterStoreInfo.ID = #MasterStoreInfo_Helper.ID)
LEFTJOIN MasterStoreList ON #MasterStoreInfo_helper.StoreName = MasterStoreList.StoreName

Which with my make table statement, the temp tables are created, the Select statements are run, the results are displayed and the temp tables are dropped. So the temp tables need to be re-created at the beginning of each make-table run. Is it possible to do something like this with a view?

Viewing all articles
Browse latest Browse all 13329

Trending Articles