---
schema_version: "1"
id: dd969fd4d91105ec5acda957f365378332f89743296e0b5bc1f6d13c877f6830
title: Update
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_queryDefinitionUpdate.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_queryDefinitionUpdate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8a4f317835fd05429f668b6e3858101d9bea79419e13046a557819b718c68880
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Update

## Overview

Updates a query definition and returns a status of OK or an error message

### Syntax

Update(1)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                               |
| ------- | ------ | ------------ | ----------------------------------------- |
| **1**   | object | **Required** | Attributes for query definition to change |

## Example

This sample code updates the name and query of the query definition:

```
var qd = QueryDefinition.Init("myQueryDef");

var status = qd.Update({
    Name : "Updated Query Definition Name",
    QueryText : "SELECT SubKey, Email, Name FROM [Example Target DE] where FavoriteItemID=12"
});
```
