Just another day, I have received an email from a regular client of Comprehensive Database Performance Health Check. My client wanted to learn the trick to Move a Table From One Schema to Another Schema. Let us learn it today.
They had recently imported a huge amount of data from another server. Now accidentally they had given the incorrect name of a schema for the table creation. They wanted to move their newly created table from one schema to another schema. This process is very easy to do and let us learn it together.
ALTER SCHEMA NewSchema TRANSFER OldSchema.TableName;
That’s it. You can now move your table from older schema to newer schema. I hope you find this quick blog post helpful.
Here are my few recent videos and I would like to know what is your feedback about them. You can subscribe to my youtube channel here.
- Count Table in Cache – SQL in Sixty Seconds #149
- List All Sessions – SQL in Sixty Seconds #148
- Line Numbers for SSMS Efficiency – SQL in Sixty Seconds #147
- Slow Running Query – SQL in Sixty Seconds #146
- Change Database and Table Collation – SQL in Sixty Seconds #145
- Infinite Loop – SQL in Sixty Seconds #144
- Efficiency Trick – Query Shortcut – SQL in Sixty Seconds #143
- SQL SERVER – 16 CPU vs 1 CPU : Performance Comparison – SQL in Sixty Seconds #142
- SQL SERVER – TOP and DISTINCT – Epic Confusion – SQL in Sixty Seconds #141
Reference: Pinal Dave (https://blog.sqlauthority.com)
3 Comments. Leave new
Pinal, great post. Quick question, should the process to move a table from one schema to another take a long time? What if the table is being accessed? I suspect you would want to set the database to single user mode and then perform the schema change.
How can I move all Tables in synapse
No idea, I have never tried it.