June 20, 2011 at 5:09 am
Is it possible to do this:
table1 =
id, date
proc1 returns the date
insert table1 values (1, exec proc1)
i know i can insert into just the date & come back after for the id, but is it possible to achieve both in 1 insert?
thanks.
June 20, 2011 at 5:24 am
June 20, 2011 at 5:28 am
if you cannot use the builtin getdate() function for the current date and time,
you can stick the results into a temp table, and insert from there as well.
CREATE TABLE #temp(ColumnList...)
INSERT INTO #temp
EXEC (Proc1)
INSERT INTO AnotherTable(OtherColumn,ColumnList)
SELECT 1,ColumnList from #temp
Lowell
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply