insert into dbo.Repository(STATE_CODE,ZIPCODE)
values('SA','560064'),
WHERE JOBDIVA_ID = '23-00871';
output :
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'WHERE'.
SQL command for inserting data into specific row with given column name value condition.
2条答案
按热度按时间guykilcj1#
Assuming T-SQL, quite a few things wrong here...
The correct INSERT command would be (assuming the datatypes are correct):
The main issue is the comma followed by the WHERE clause.
If the JOBDIVA_ID column is an attribute of the dbo.Repository table, then it looks like you are wanting an UPDATE command which would be:
If the JOBDIVA_ID was an attribute of a different table then you might be looking for:
Or maybe even (this makes no sense):
kuuvgm7e2#
In an insert statement you wouldn't have an existing row to do a where claues on. You must use update statement depending on the data conditions