I have an SQL query in which I need to insert a string variable but I am getting errors from it.
Below is my SQL INSERT query:
Insert into User(Employee, Name, Address, Role, Action)
Select distinct ur1.Employee, ur1.Name, ur1.Address, ur1.Role, ['%" + action + "%'] as [Action] FROM UserRoles ur1)";
string action="insert delete query in database"
I would like to insert string action into my INSERT statement, but I am getting lots of syntax errors.
Can anyone help me with the query?
Thank you in advance for any help.
FROM UserRoles ur1)if you don't want engine complains becauseur1.Employee, ...don't exist.