SQL Studio


UPDATE
UPDATE
[TOP  expression]
entity_logicalname 
SET { column_name = { value | NULL } } [ ,...n ] 
[ WHERE <search_condition> ] 
  • To reduce load on the server, the TOP defaults to 10
  • Any WHERE conditions are evaluated first. Once all matching records have been identified, updates are executed.
  • If the only search condition is either an '=' or an 'in' on the primary key, the updates are sent directly. Otherwise it executes a paged select request, and updates those records. It then repeats this until no more records are returned
  • statecode can only be paired with statuscode. The SetStateRequest is used instead of the an UpdateRequest
  • ownerid can not be paired with any other field. The AssignRequest is used instead of the an UpdateRequest
  • in cases where SQL Studio can't automaticly determine a lookup type when setting a field use the lookup syntax of 'entityname:GUID'
Examples
update contact 
set telephone1 = '480-555-****', 
where contactid in (
'{DC681F5E-8CD0-47A5-B1BC-2367C50C39E3}',
'4E6B140B-CF2C-4D44-9084-F6C27C5934C0'
)