# MS SQL connect by app or session?

**URL:** <https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241>\
**Category:** Databases\
**Created:** [March 25, 2014, 3:00pm UTC](https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241 "2014-03-25T15:00:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_Wright](https://forum.xojo.com/user_avatar/forum.xojo.com/nathan_wright/32/575_2.png) [@Nathan\_Wright](https://forum.xojo.com/u/Nathan_Wright)\
**Post date:** [March 25, 2014, 3:00pm UTC](https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241/1 "2014-03-25T15:00:59Z")

</div>

I have a web project and am just about to start playing with connecting to my MS SQL database to select / insert data etc. Should the connection be made at the app, session or object / event level for best performance / reliability?

---

<div class="post-metadata">

**Author:** ![Daniel\_Taylor](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@Daniel\_Taylor](https://forum.xojo.com/u/Daniel_Taylor)\
**Post date:** [March 25, 2014, 3:31pm UTC](https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241/2 "2014-03-25T15:31:46Z")

</div>

This ultimately depends on what you’re doing. But generally you want to have a separate connection for each session. You may run into situations where you have additional connections for specific objects (i.e. controls, threads) for performance or concurrency reasons.

---

<div class="post-metadata">

**Author:** ![Nathan\_Wright](https://forum.xojo.com/user_avatar/forum.xojo.com/nathan_wright/32/575_2.png) [@Nathan\_Wright](https://forum.xojo.com/u/Nathan_Wright)\
**Post date:** [March 25, 2014, 4:49pm UTC](https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241/3 "2014-03-25T16:49:46Z")

</div>

Thats what I thought would be the case, thanks.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:08pm UTC](https://forum.xojo.com/t/ms-sql-connect-by-app-or-session/15241/4 "2020-10-29T17:08:28Z")

</div>


