Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

T-sql query to check if the columns have null then insert into new column

$
0
0

Hi,

I have a table with columns res_street_address,res_Zip,mail_street_address,mail_Zip.I have to insert these columns values to destination table with columns Street_address and Zip with condition that If res_street_address is not null or mail_Zip is not null then insert residential address into Street_address otherwise mailing address into Street_address .

I came up with solution in SSIS(Isnull(res_address)=true||isnull(mail_address)=true in conditional split) but the requirement is I need to come up with T-sql.Would you mind helping me?

Thanks Inadvance.


Viewing all articles
Browse latest Browse all 8428

Trending Articles