Hello,
how can we update null value columns in whole table in sql server, without using column name?
I want to update all null value columns in a table, many columns in my table, So, can we update all null value columns without using column name?
Please help me.
Thanks in advance.
Ankit Agarwal
Software Engineer
Loading


Priyanka JainRank #2,756 · 509 reputationPosted Aug 29, 2013, 2:07 AM EDT
update tablename set columnname=value where columnname is null
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 29, 2013, 2:15 AM EDT
By using the below query you can find all column which are null
Regards,
Iftikar
Rosi Sreenivasa Reddy137 reputationPosted Aug 29, 2013, 3:17 AM EDT
can you explain clearly about it?
Ankit AgarwalRank #4,422 · 344 reputationPosted Aug 29, 2013, 3:42 AM EDT
will we write every column name?
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 29, 2013, 3:51 AM EDT
Priyanka JainRank #2,756 · 509 reputationPosted Aug 29, 2013, 8:53 PM EDT
suppose your table name is tab1
and table have following structures and data
so you have to write
update tab1 set name='n' where name is null
update tab1 set pincode='6' where pincode is null