troubleshooting Question

Search 3 data fields in a table to find the first value and return a single field in a stored procedure

Avatar of Gary Demos
Gary DemosFlag for United States of America asked on
Microsoft SQL ServerC#SQLMicrosoft Visual Studio
28 Comments1 Solution131 ViewsLast Modified:
In a stored procedure I would like to examine 3 SQL char data fields in a table that contain phone numbers. Some of the fields have no value (but they are not null). I want to find the first field that has a value (phone number) and then return that value to a newly created field that I can pass on to my Visual Studio 17 C#  program.

Example:
table1.field1 = ""
table1.field2 = 1234567891
table1.field3 = 2345678966

table1.new_field = 1234567891
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 28 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 28 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros