Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 8-Sep-11 23:35pm
v3

Messing with sysobjects is not advisable. You can do everything you need via ALTER TABLE
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900