Lionel2007 (3/3/2008)
Hi,I need to modify data in a table using Query Analyzer. What is the syntax?
Update [tablename]
set [columnnameA] = yourdata,
[columnnameB] = moredata
where [primarykeycolumn] = primarykeyid for row you want to update
This will update 2 columns (column A, column B) on 1 row of data(controlled by 'where' statement). You can add additional columns as necessary for your data. Please note, that if you leave off the 'where', you will update every row in the table [tablename] with the same data, and you probably don't want to do this.
If your requirements are more complex, please respond with additional details.
Hope this helps!
If it was easy, everybody would be doing it!;)