Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi,I have data in the following format in one tableCol1 Col2 LOGINIDthis isGH75684 NULL NULLDFGERTYE99978 DFDSGFSD678 NULLNULL which isRT56789 NULLLOGISTINCTS IN I knowsGT34562 NULLAFTER EXECUTION SHOULD LOOK LIKE Col1 Col2 LOGINIDthis isGH75684 NULL GH75684DFGERTYE99978 DFDSGFSD678 YE99978NULL which isRT56789 RT56789 LOGISTINCTS IN I knowsGT34562 GT34562I want to populate LoginID column by using Col1 and Col2The Login ID is placed randomly in the text.Login ID is in the format AB12345 (first two character and then five integers)The script should first search login ID in Col1, If not found in Col1 the search in Col2, IF FOUND UPDATE LOGINID columnPlease help.Regards,Sachin