Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Deleting Content

Author  Topic 

toxicrainpx
Starting Member

8 Posts

Posted - 2008-12-24 : 06:47:18
Hello, I'm trying to learn SQL and I have a simple question. What's the right command to delete the content of a field on a specific table?? I don't want to replace with "", I just want to delete all the contents of that field in that table. Thanks in advance.

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-12-24 : 06:54:44
[code]ALTER TABLE YourTable DROP COLUMN NameOfColumnYouWantToDrop[/code]
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-12-24 : 09:38:35
quote:
Originally posted by sakets_2000

ALTER TABLE YourTable DROP COLUMN NameOfColumnYouWantToDrop




as long as you realize the column is then deleted, not only the contents....if you want the column to remain but not the contents, you have little choice:
update yourtable set yourcloumn = null (or '')

Terry
Go to Top of Page
   

- Advertisement -