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
 delete

Author  Topic 

Riya
Starting Member

6 Posts

Posted - 2009-04-01 : 08:30:19
how can i delete values of 1 column. please give me syntax .thanx in advance

Thanks alot
Riya

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-01 : 08:36:16
1. UPDATE Table1 SET Col1 = NULL
2. ALTER TABLE Table1 DROP COLUMN Col1




E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-04-01 : 08:37:19
either update them as null.
update yourtable set yourcolumn=null

Or,

Drop the column
ALTER TABLE yourtable DROP COLUMN yourcolumn
Go to Top of Page

Riya
Starting Member

6 Posts

Posted - 2009-04-01 : 09:12:50
thanx guys. i updated the column values to null.
but the problem is my table have null records(null value for all columns).can u plz tell me how can i remove these null records?

Thanks alot
Riya
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-01 : 09:15:32
use replace clause to do this,,
like
update urtable set column=(replace,Null,'')

or u can also use isnull like that
isnull(column,'')

May Be U want That???
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-04-01 : 09:17:04
update != remove

DELETE FROM <yourtable> WHERE (COL1 is null AND COL2 is null ...)

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Riya
Starting Member

6 Posts

Posted - 2009-04-02 : 02:11:28
thanx DonAtWork & Ashish.



Thanks alot
Riya
Go to Top of Page
   

- Advertisement -