a little question about C# stored procedures…and SQL DB in general:
When you are passing a variable value from C# to a stored procedure, at times you have
INSERT INTO tablename (column1 name, column2 name, column3 name, columnN name)
VALUES (@the actual values1, @values2, @valueN);
other times you dont have the column names but only the VALUES being entered…
what would happen if I typed something like this, (assume table has 3 columns called “bob”, “ash”, and “will”):
INSERT INTO tablename (bob, will) VALUES ("hi","hello");
OR
INSERT INTO tablename (bob, will) VALUES ("hi","hello","okay");
OR
INSERT INTO tablename (bob, will) VALUES ("hello");
how will it affect the entry?
First query insert that record correctly (if there are no primary keys violations).
Second query fails because you have three values and two fields.
Third query fails because you have one value for two fields.