I have written the following query to insert values from one table to other along with some variables.
But the syntax seems to be incorrect as i am unable to get the result:
INSERT INTO [tran].[ohlc_price]
([symbol_id]
,[timestamp]
,[datetime]
,[open_price]
,[high_price]
,[low_price]
,[close_price]
,[digits]
,[type]
,[created_date]
,[created_by])
values (
@get_symbol_id, select
#temp_ohlc.timestamp,
#temp_ohlc.datetime,
#temp_ohlc.open_price,
#temp_ohlc.close_price,
#temp_ohlc.high_price,
#temp_ohlc.low_price,
#temp_ohlc.digits,
#temp_ohlc.type from #temp_ohlc,
@get_date,
user_name()
)
What is wrong in syntax. Please help. I am getting error:
Msg 156, Level 15, State 1, Procedure ohlc_price_save, Line 119 [Batch Start Line 9] Incorrect syntax near the keyword 'select'.