Skip to navigation
How insert directly to a temporary mssql table
08.03.16
example: first drop the temp table. than insert the result to the temp table. after left join the temp table with others drop table #temp SELECT av0_style INTO #temp FROM [SL].[dbo].[av0_style] AS s LEFT JOIN [SL].[dbo].[mq_min_qty] AS m ON s.av0_style = m.mq_style WHERE s.av0_metal = 'SIL' AND m.mq_location = '11' AND m.mq_stock_min_qty > 0 SELECT t.av0_style ,y.yz3_qty ,s.av0_item_type from #temp AS t LEFT JOIN [SL].[dbo].[mq_min_qty] AS m ON t.av0_style = m.mq_style LEFT JOIN [SL].[dbo].[yz3_stock] AS y ON t.av0_style = y.yz3_style LEFT JOIN [SL].[dbo].[av0_style] AS s ON t.av0_style = s.av0_style WHERE m.mq_location =1 AND y.yz3_location = 11 AND (m.mq_stock_min_qty = 0 OR m.mq_stock_min_qty is NULL)
http://sqlserverplanet.com/tsql/create-index-on-temp-table
Reply
Anonymous
Information Epoch 1740160981
Files are bags of bytes.
Home
Notebook
Contact us