how can i insert data into temp table from 2 diferent tables, and get data from temp table.
My following code giving output just from 2nd table. how can i append 2nd table data("new_BannerList" table) into temp table after inserting
1st table data("WDI_T_PartnerRegistration" table).
ALTER PROCEDURE dbo.GetAllAdBanner
AS
BEGIN
CREATE TABLE #TempTable
(
UserName VARCHAR(100),
Banner VARCHAR(200)
)
INSERT INTO #TempTable
Select PR.UserName AS UserName, PR.Banner AS Banner from WDI_T_PartnerRegistration PR ,WDI_M_Users MU where MU.UserId=PR.UserName
and MU.UserType=3 and PR.Status=1 and PR.Banner!= ''
Select NBL.PartnerID AS UserName, NBL.Banner AS Banner from new_BannerList NBL where NBL.Banner!=''
SELECT * FROM #TempTable
drop table #TempTable
END
Thanks,
Mohfeza