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 JainPosted Aug 30, 2013, 12:53 AM
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
Iftikar HussainPosted Aug 29, 2013, 7:51 AM
Ankit AgarwalPosted Aug 29, 2013, 7:42 AM
will we write every column name?
Rosi Sreenivasa ReddyPosted Aug 29, 2013, 7:17 AM
can you explain clearly about it?
Iftikar HussainPosted Aug 29, 2013, 6:15 AM
By using the below query you can find all column which are null
Regards,
Iftikar
Priyanka JainPosted Aug 29, 2013, 6:07 AM
update tablename set columnname=value where columnname is null