Related questions
SQL error: Incorrect syntax near the keyword 'User'
I am using SQL to insert data to SQL Database file using C# as follows.
String cs = System.Configuration.ConfigurationManager.ConnectionStrings["connection1"].ConnectionString;
SqlConnection conn = new SqlConnection(cs);
String sql = "INSERT INTO User (login, password, status) " +
"VALUES (@login, @password, @status)";
…
How do I UPDATE from a SELECT in SQL Server?
In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement:
INSERT INTO Table (col1, col2, col3)
SELECT col1, col2, col3
FROM other_table
WHERE sql = 'cool'
Is it also possible to update a …