
# set_current_snapshot
#### 基本语法
可使用**set_current_snapshot**设置表的当前快照ID。与回滚不同，该操作不要求目标快照必须是表当前状态的祖先快照。例如：
将**db.sample**表的当前快照设置为ID为10963874102873的快照：
```
CALL prod.system.set_current_snapshot('db.sample', 10963874102873);
```
将**db.sample**表的当前快照设置为标签s1对应的快照：
```
CALL prod.system.set_current_snapshot(table => 'db.sample', ref => 's1');
```
其中，表名字段的类型为string，快照ID字段的类型为long，"ref"为设置当前快照的快照引用（分支或标签），类型为string。且必须设置快照ID或ref，二者不可同时提供，也不可均不提供。
输入参数介绍请参见[表1]。
 表1快照设置输入参数 
| 参数          | 是否必选 | 类型     | 说明                  |
|:---|:---|:---|:---|
| table       | 必选   | string | 需要更新的表名。            |
| snapshot_id | 可选   | long   | 需要设置为当前快照的快照ID。     |
| ref         | 可选   | string | 需要设置为当前的参照（分支或者标签）。 |
   
输出结果介绍请参见[表2]。
 表2快照设置输出结果 
| 参数                   | 类型   | 说明           |
|:---|:---|:---|
| previous_snapshot_id | long | 设置前的当前快照ID。  |
| current_snapshot_id  | long | 设置后新的当前快照ID。 |
   
