# Database User Source - any way to add multiple contact info

**URL:** <https://forum.inductiveautomation.com/t/database-user-source-any-way-to-add-multiple-contact-info/77716>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 10, 2023, 7:05pm UTC](https://forum.inductiveautomation.com/t/database-user-source-any-way-to-add-multiple-contact-info/77716 "2023-08-10T19:05:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveRNeal](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@DaveRNeal](https://forum.inductiveautomation.com/u/DaveRNeal)\
**Post date:** [August 10, 2023, 7:05pm UTC](https://forum.inductiveautomation.com/t/database-user-source-any-way-to-add-multiple-contact-info/77716/1 "2023-08-10T19:05:28Z")

</div>

Good afternoon. I'm attempting to add both a phone number and separate sms number to each user's contact info in a database user source. I can add 1 or the other without any issue in the Contact Info Query field, but when trying to add both only the first one I enter shows up for each user. Is there something I might be overlooking? I've also tried adding the second number in the Extra Properties Query field with no luck. Below is what I thought might work in the Contact Info Query.

SELECT 'phone',[PhoneNo], 'sms',[CellPhoneNo] FROM [dbo].[EmployeeDatabase] Where UserName = ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 10, 2023, 8:33pm UTC](https://forum.inductiveautomation.com/t/database-user-source-any-way-to-add-multiple-contact-info/77716/3 "2023-08-10T20:33:20Z")

</div>

He's in the context of a Database user source in manual mode, where you write queries out as strings and they're automatically executed by the gateway internally:  
[https://docs.inductiveautomation.com/display/DOC81/Database+Authentication#DatabaseAuthentication-ManualMode](https://docs.inductiveautomation.com/display/DOC81/Database+Authentication#DatabaseAuthentication-ManualMode)

> [@DaveRNeal](#):
>
> Below is what I thought might work in the Contact Info Query.

You need to return multiple rows, IE a union, rather than additional columns horizontally.  
So in theory something like `select 'phone', phoneNumber UNION select 'sms', smsNumber`... but, we're only going to substitute in a single uname parameter, so you can't just run the same select twice...

From the square brackets/`dbo`, I'm assuming you're using MSSQL - so maybe you could add an `UNPIVOT` clause to your existing query to get it into the appropriate format?

> **[Using PIVOT and UNPIVOT - SQL Server](https://learn.microsoft.com/en-us/sql/t-sql/queries/from-using-pivot-and-unpivot?view=sql-server-ver16#unpivot-example)**
>
> Transact-SQL reference for PIVOT and UNPIVOT relational operators. Use these operators on SELECT statements to change a table-valued expression into another table.

---

<div class="post-metadata">

**Author:** ![DaveRNeal](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@DaveRNeal](https://forum.inductiveautomation.com/u/DaveRNeal)\
**Post date:** [August 10, 2023, 10:18pm UTC](https://forum.inductiveautomation.com/t/database-user-source-any-way-to-add-multiple-contact-info/77716/4 "2023-08-10T22:18:32Z")

</div>

Perfect, thank you for clarifying! I didn't realize the information needed to be in multiple rows.
