Page 1 of 1

Insert Select data from another table

Posted: Tue Mar 21, 2017 2:55 am
by ahosny1

Please help identifying the error resulting : Incorrect syntax near the keyword 'SELECT'. Incorrect syntax near ')'.

Code in my Page_Render server event:

string sInsertSql = "INSERT INTO Monthly (PeriodID,EmployeeID,Salary) Values (99,99,"+" SELECT Salary FROM Employees WHERE EmployeeID = 2 "+" ) ";
ew_Execute(sInsertSql);


Re: Insert Select data from another table

Posted: Tue Mar 21, 2017 7:42 am
by ahosny1

it was a missing () around the select statement