Click here to Skip to main content
13,045,019 members (45,234 online)
Rate this:
Please Sign up or sign in to 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 Query...??
Posted 13-Sep-12 20:46pm
__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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

without condition
update Contacts set profile_image = null 

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

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


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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100