如何删除sysobjects中的列数据但不删除它们之间的关系 [英] how to delete columns data in sysobjects but not deleted their relations

查看:88
本文介绍了如何删除sysobjects中的列数据但不删除它们之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

如何删除所有系统表列数据,但不删除它们之间的关系
只有数据将被删除.即应保持主键和外键的关系

在此先感谢

Hello

how to delete all system table columns data but not delete their relationships
only data would be deleted. i.e Primary key and foreign key relations should be maintained

thanks in advance

推荐答案

不建议使用sysobjects进行处理.您可以通过ALTER TABLE
Messing with sysobjects is not advisable. You can do everything you need via ALTER TABLE


完成所有需要的操作!他们受到了保护,这是有充分理由的.

SQL语言基本上包含两个不同的部分. DML和DDL.

DML [ ^ ](数据操作语言)用于修改用户表中的数据.这是您在自己的表中添加,删除或更新记录时使用的方法.

DDL [ ^ ](数据定义语言)用于修改数据库结构,例如:添加表,列,创建过程等.

所有的DDL命令实际上都使用DML来修改保存该结构的系统表的内容.但是,由于未发布系统表的所有内部结构和逻辑,因此没有可靠的方法直接修改系统表,以免例如损坏系统.

如果您需要对数据库结构进行特定的修改,请将其发布为新问题,我相信您会得到帮助.
Never ever touch the system tables! They are protected and for a very good reason.

SQL language basically contains two different parts. DML and DDL.

DML[^] (Data Manipulation Language) is used for modifying the data in user tables. This is what you use when you add, remove or update records in your own tables.

DDL[^] (Data Definition Language) is used to modify for example the database structure: add tables, columns, create procedure etc.

All the DDL commands do actually use DML to modify the contents of the system tables where the structure is held. But since all of the internals and logic of the system tables are not published, there''s no reliable way to directly modify the system tables so that the system wouldn''t for example get corrupted.

If you have a specific modification you need to do to the database structure, post it as a new question and I''m confident that you''ll get help.


这篇关于如何删除sysobjects中的列数据但不删除它们之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆