I have a database in SQL Server where I've migrated some tables from Oracle. Now, these migrated tables have a different schema from the default .dbo
.
I've selected all table names with this query:
select '[' + SCHEMA_NAME(schema_id) + '].['+name+']' as SchemaTable
from sys.tables
where schema_name(schema_id) like '%my_schema%'
and I want to move all these tables from db1
to db2
.
Is there a way to just move all those tables without making a copy (I think I can do a select * from...
with all table names, but there is, like, a thousand tables, so that solution would take quite some time).