Click here to Skip to main content
11,719,867 members (89,080 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server-2008
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
Comments
__TR__ at 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
good
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!
Smile | :)
  Permalink  
Comments
Pratibha Mhatre at 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 at 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
0 Sergey Alexandrovich Kryukov 665
1 OriginalGriff 340
2 F-ES Sitecore 185
3 Suvendu Shekhar Giri 140
4 Maciej Los 100
0 Sergey Alexandrovich Kryukov 1,734
1 OriginalGriff 690
2 Maciej Los 569
3 Richard MacCutchan 540
4 F-ES Sitecore 510


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2015
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