Posted by cavassinif on 01/20/06 21:49
I need to dynamic select a column in which insert a vale based on a
parameter value, I have this code, but it throws an incorrect syntax
error.
How do I dinamically select a column to insert based on a parameter?
Create PROCEDURE dbo.UpdateDetalleOT (
@eotId int,
)
insert into OT (
select Case
when @eotId = 1 THEN OTFechaBorrador
when @eotId = 2 THEN OTFechaAAsignar
end
) values ....
Best Regards
Fabio Cavassini
http://www.pldsa.com
Navigation:
[Reply to this message]
|