更新时间:2022-05-28 07:54:32
根据你的评论你尝试将MyTableName
表从dbo
移至xxx
.. 。
你命令尝试做相反的事情。
ALTER SCHEMA的格式是这样的
According to your comment you try to moveMyTableName
table fromdbo
toxxx
...
You command try to do just the opposite.
The format of ALTER SCHEMA goes like this
ALTER SCHEMA {target-schema-name} TRANSFER {original-schema-name}.{table-name}
在你的情况下
In you case
ALTER SCHEMA xxx TRANSFER dbo.MyTableName
例如,参见这个Stack Overflow问题 [ ^ ]。
在你的sql server中是否有任何名为xxx的模式,如果没有,那么创建一个
is there any schema named xxx in your sql server if not then create one
CREATE SCHEMA xxx
然后尝试改变你的表格
then try alter Your Table Like
ALTER SCHEMA NewSchema TRANSFER OldSchema.YourTable
GO
了解更多细节请参阅 ALTER SCHEMA(Transact-SQL)