I am trying to create a temp table.
SET @pstartDate = '01-01-2013'
SET @pendDate = '31-12-2013'
SET @cstartDate = '01-01-2014'
SET @cendDate = '31-12-2014'
CREATE TABLE #Temp
(
pId int,
pname varchar,
ptype varchar,
pstartDate date,
pEndDate date,
cStartDate date,
cEndDate date
)
I will get pId, pname, ptype from product table.
SELECT *
INTO #Temp
FROM product
INSERT INTO #TempTable (pStartDate, pEndDate, cStartDate, cEndDate)
VALUES (@pStartDate, @pEndDate, @cStartDate, @EndDate)
I want the value of column pStartDate as '01-01-2013', pEndDate as '31-12-2013', cstartDate as '01-01-2014' and cEndDate as '12-31-2014' for all the rows in #Temp
table
I am trying in this way, but not getting values inserted into temp table.