|
Posted by Erland Sommarskog on 05/30/06 21:15
(serena.delossantos@lmco.com) writes:
> Trying to insert into a history table. Some columns will come from
> parameters sent to the store procedure. Other columns will be filled
> with a separate select statement. I've tried storing the select return
> in a cursor, tried setting the values for each field with a separate
> select. Think I've just got the syntax wrong. Here's one of my
> attempts:
Try:
INSERT tbl (col1, col2, col3, ....)
SELECT @par1, @par2, col
FROM ESBAOffsets..Offsets_Master
WHERE RECID = @RECID
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|