# Need help with simple select statement

**URL:** <https://forum.inductiveautomation.com/t/need-help-with-simple-select-statement/9548>\
**Category:** Ignition\
**Created:** [January 15, 2015, 5:08pm UTC](https://forum.inductiveautomation.com/t/need-help-with-simple-select-statement/9548 "2015-01-15T17:08:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [January 15, 2015, 5:08pm UTC](https://forum.inductiveautomation.com/t/need-help-with-simple-select-statement/9548/1 "2015-01-15T17:08:38Z")

</div>

I have a project that defaults to DB1 database.

I need to create a SQL statement that pulls data from DB2 connection.

SQL \* DB2.MachineWorkOrders  
Doesn’t work for me. What am I missing??

I am assuming DB1 and DB2 are the names of the connection documents within Ignition. I have also tried it with the hostnames to no avail. Always get an Invalid object name…

---

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [January 15, 2015, 8:19pm UTC](https://forum.inductiveautomation.com/t/need-help-with-simple-select-statement/9548/2 "2015-01-15T20:19:56Z")

</div>

SELECT \*  
FROM DB2.dbo.MachineWorkOrders

Maybe?

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [January 15, 2015, 8:58pm UTC](https://forum.inductiveautomation.com/t/need-help-with-simple-select-statement/9548/3 "2015-01-15T20:58:45Z")

</div>

You could create another datasource in Ignition that uses the DB2 database.
