Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored proc: Insert Into

Status
Not open for further replies.

MarkGreen

Technical User
Oct 4, 2002
40
GB
Hi,
I need to copy some selected data from one table to another using a stored proc. This isnt a problem - i figured i should be using insert into. However the problem is, the table that I am inserting into needs to obtain one of its column values from a local variable and not from the select statement.

What is the syntax for doing this?

Thanks,
Mark.
 
hi,

Try this....


declare @l varchar(20)
set @l ='25'
insert into yourtable(field1,field2,LocalvariableField)
select field1,field2,@l from charge



Hope it helps....

Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top