How to store the result set of the given query in a new table.
select d1.year,d1.month,d1.Circle_code,d1.Call_type_code,d1.DescId,d1.CustId,
d1.call_logged,d2.Call_Cancel
from dbo.Table_M_CALL_LOGGED as d1
join dbo.Table_M_CALL_CANCEL as d2 on
d1.year=d2.year
and d1.month=d2.month
and d1.Circle_Code=d2.Circle_Code
and d1.Call_Type_Code=d2.Call_Type_Code
and d1.DescId=d2.DescId
and d1.CustId=d2.custID
I am creating here new temporary table to just you show how to insert query result directly into table….
Below method is used when table is not created earlier and needs to be created when data from one table is to be inserted into newly created table from another table. New table is created with same data types as selected columns.