在 MS SQL Server 2005 中编辑同义词
出于好奇,有什么方法可以编辑现有的同义词吗? 也就是说,更改同义词指向的表...
到目前为止,我似乎必须删除并重新创建它们,因为它们被锁定而无法编辑。 这没什么大不了的,但同时也有点令人恼火。
GUI 或脚本,但最好是 GUI。
Out of curiousity, is there any way to edit an existing synonym? That is, change which table the synonym is pointing to...
Thus far I seem to have had to delete and re-create them, because they're locked from being edited. It's not a big deal, but at the same time it's a little irritating.
GUI or scripting, but preferably GUI.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有
您必须删除并重新创建同义词。 请参阅本文。
There is no
You have to drop and recreate the synonym. See this article.
不幸的是没有 ALTER SYNONYM。 不过,Microsoft Connect 中有一个反馈要求提供此功能。 不过微软的回复不是很明确。 他们谈论 Katmai 中的一些附加功能,但我无法理解。 检查此链接
我认为同义词被大大低估了,未得到充分利用。 考虑这种情况。 您正在运行 SQL Express,每个数据库限制为 4 GB。 当您的数据库接近 4 GB 时,只需将较大的表移动到另一个数据库并在原始数据库中创建同义词,您就可以有效地将数据库大小增加到 4 GB 以上。
虽然 OP 问题的答案是否定的,但我只是想我应该与社区分享这一点,以使我们这些使用 SQL Express 并被 4 GB 限制所困扰的人受益。
拉吉
Unfortunately there is no ALTER SYNONYM. There is however a feedback in Microsoft Connect asking for this functionality. The reply from Microsoft is not very clear though. They talk about some added functionality in katmai, but I am not able to understand that. Check this link
I think synonyms are vastly under-rated and under-utilized. Consider this scenario. You are running SQL Express with a limit of 4 GB per database. When your DB is almost at 4 GB, just move the larger tables to another DB and create a synonym in the original DB and you have effectively increased your DB size to beyond 4 GB.
Though the answer to the OP's question is NO, just thought I should share this with the community to benefit those of us using SQL express and are stumped with the 4 GB limit.
Raj
掉落& 重新创建同义词
例如:
1.删除现有同义词后
2.USE '您的数据库'
GO
CREATE SYNONYM '您的同义词名称' FOR '哪个表的同义词'
GO
Drop & recreate the synonym
Ex:
1.After you drop the existing synonym
2.USE 'Your DB'
GO
CREATE SYNONYM 'Your synonym name' FOR 'Synonym for which table'
GO