Click here to Skip to main content
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 21: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 OriginalGriff 410
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 105
4 PIEBALDconsult 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2014
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