adspace


How to update multiple rows with one update statement in ms sql server?

Answer Posted / Anmol Kumar

To update multiple rows with one update statement in MS SQL Server, you can use the WHERE clause to specify the rows that need to be updated. Here's an example:nn```sqlnUPDATE TableNamenSET Column1 = 'New Value', Column2 = 'New Value'nWHERE Condition;n``` Replace `TableName`, `Column1`, `Column2`, and `Condition` with your table name, the column names you want to update, and a condition that specifies which rows should be updated.n

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I create a trace in sql server?

1120


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1299


Can we make the the chages By Using the Sql if u know any function or process please inform me Actuall result: BRK1 Break 1 Part 1 00:01:00:00 60 BRK1 Break 1 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 BRK2 Break 2 Part 2 00:01:00:00 60 BRK2 Break 2 Part 3 00:01:00:00 60 BRK3 Break 3 Part 1 00:01:00:00 60 BRK3 Break 3 Part 2 00:01:00:00 60 Desired O/P: BRK1 Break 1 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 Part 3 00:01:00:00 60

2295


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1196


List the ways in which dynamic sql can be executed?

1085


How do I find the sql server version?

1102


If any stored procedure is encrypted, then can we see its definition in activity monitor?

1071


When should you use an instead of trigger?

1052


What are the properties of the transaction?

1072


What is a scheduled job or what is a scheduled task?

1039


What is a view in sql?

1040


How to remove duplicate rows from table except one?

1088


What is sql or structured query language?

1226


How do I start sql server 2017?

1015


do you know how to configure db2 side of the application? : Sql server database administration

1123