# How can I use the schema name when I'm renaming a table?

**URL:** <https://community.cratedb.com/t/how-can-i-use-the-schema-name-when-im-renaming-a-table/1025>\
**Category:** CrateDB\
**Created:** [February 25, 2022, 10:11am UTC](https://community.cratedb.com/t/how-can-i-use-the-schema-name-when-im-renaming-a-table/1025 "2022-02-25T10:11:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emre\_Sevinc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/emre_sevinc/32/375_2.png) [@Emre\_Sevinc](https://community.cratedb.com/u/Emre_Sevinc)\
**Post date:** [February 25, 2022, 10:11am UTC](https://community.cratedb.com/t/how-can-i-use-the-schema-name-when-im-renaming-a-table/1025/1 "2022-02-25T10:11:01Z")

</div>

Hello,

I’m trying to rename one of my tables (I’m following [ALTER TABLE — CrateDB: Reference](https://crate.io/docs/crate/reference/en/4.7/sql/statements/alter-table.html#rename-to)), but I’m getting `SQLParseException[Target table name must not include a schema]` error:

```auto
ALTER TABLE log.partitioned_requests RENAME TO log.old_requests ;

Error!

SQLParseException[Target table name must not include a schema]

Error trace
io.crate.exceptions.SQLParseException: Target table name must not include a schema
	at io.crate.exceptions.SQLExceptions.esToCrateException(SQLExceptions.java:139)
	at io.crate.exceptions.SQLExceptions.prepareForClientTransmission(SQLExceptions.java:128)
	at io.crate.rest.action.SqlHttpHandler.sendResponse(SqlHttpHandler.java:162
        ...

```

How can I perform this operation? I want the new table name to be also in the same schema.

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [February 25, 2022, 10:16am UTC](https://community.cratedb.com/t/how-can-i-use-the-schema-name-when-im-renaming-a-table/1025/2 "2022-02-25T10:16:40Z")

</div>

> [@Emre\_Sevinc](#):
>
> `ALTER TABLE log.partitioned_requests RENAME TO log.old_requests ;`

This should work:

```auto
ALTER TABLE log.partitioned_requests RENAME TO old_requests ;

```
