Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am having a table with name Contacts in SQL Server 2008, its having one column profile_image, i want set the value of column to null.
Profile_column having more than 100 records. how do i solve this with one
SQL

sql Query...??
Posted
Comments
__TR__ 14-Sep-12 2:49am    
Update Contacts
SET profile_image = NULL

The above update statement will set the profile_Image column to null for all rows. Is this what you want to do ?

1 solution

without condition
SQL
update Contacts set profile_image = null 


with condition/filter
SQL
update Contacts set profile_image = null where YourCol=... 


Happy Coding!
:)
 
Share this answer
 
Comments
Pratibha Mhatre 14-Sep-12 3:24am    
if i want profile_image column null by default throughout then...??

or

if i want profile_image column null by default when there is no value specified then...??
Aarti Meswania 14-Sep-12 3:34am    
set column property 'allow null' it will accept null value
and then if you are not passing value to this column while inserting new record, then it will assign null value automatically :)

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