SQL Insert
Hi,
How can i insert a variable along with the value passed from a stored proc, ie. i want to pass both of them together into a table at the same time. I am using sql server 2005.
eg.
declare @extracol INT
set @extracol = 4
create table #bob_output
(
userID varchar(100),
extracol INT
)
INSERT INTO #bob_output(userID) exec bob
SELECT * from #bob_output
DROP TABLE #bob_output
This code works fine but if i want to do something like the foll it fails. Pls help with syntax:
declare @extracol INT
set @extracol = 4
create table #bob_output
(
userID varchar(100),
extracol INT
)
INSERT INTO #bob_output(userID,extracol) exec bob,@extracol ******????
SELECT * from #bob_output
DROP TABLE #bob_output
Cheers,
Kavitha
|