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
 problem with delete and truncate statemnt

Author  Topic 

mirza21
Starting Member

11 Posts

Posted - 2009-05-22 : 03:52:30
hi

i am having few doubts about delte and truncate

1)Can we delete a particular column value using delete.i know we can delete entire row.is it possible to delete single column value in row


2) can we delete row using truncate

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-22 : 03:56:13
quote:
1)Can we delete a particular column value using delete.i know we can delete entire row.is it possible to delete single column value in row

you want to remove the column from the table or just to remove the data ?
to remove the column from the table use alter table . . drop column syntax
to remove the data, just update table set col = NULL or whatever value that you wish

quote:
2) can we delete row using truncate

truncate will truncate entire table. Delete table allow you selectively delete the rows based on the WHERE conditions


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -