Hi,
Try like below.
IF NOT EXISTS(SELECT OBJECT_ID('t3'))
BEGIN
SELECT * INTO t3 from
(SELECT A.col1, A.col2, A.col3, A.id, B.t2Col1, B.t2Col2
FROM t1 A INNER join t2 B ON A.id = B.id) temp
END
select * from t3
This will create new table
t3
, with the columns from
t1
&
t2
hope it helps.