# Way to do an overlay opt out on a SQL Binding in Vision 7.9.9?

**URL:** <https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [September 15, 2021, 5:48pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011 "2021-09-15T17:48:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 15, 2021, 5:48pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011/1 "2021-09-15T17:48:16Z")

</div>

Using Ignition 7.9.9 and SQL Server.

I have a project that has many schemas, with many tables that are identical in name and shape, but each also has tables unique to them, and some tables are slightly different in between them.

We have a screen that is meant to work with all schemas. I have a custom property on a radio button that is a SQL Query that will expectedly will fail for some schemas, but in those cases the entire component is still red. I set a fallback value but I think that only works in the event that 0 rows are returned, not in the event the SQL fails.

I am using SQL Server and saw in my coworker resolve this by doing something like the following, except it is not working for me -

```auto
IF EXISTS(
	SELECT myColumn
	FROM {[Client]Schema}.someTableThatMayOrMayNotExists
	WHERE ID=1)
	Begin
		SELECT myColumn
		FROM {[Client]Schema}.someTableThatMayOrMayNotExists
		WHERE ID=1
	End
else
	Select 'None'

```

But this is not working as well. Any thoughts on how I can resolve the red overlay from a SQL binding that I expect to work in some occasions?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 15, 2021, 6:10pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011/2 "2021-09-15T18:10:57Z")

</div>

Found the right way to check if a table exists

```auto
IF (EXISTS (SELECT * 
                 FROM INFORMATION_SCHEMA.TABLES 
                 WHERE TABLE_SCHEMA = 'TheSchema' 
                 AND TABLE_NAME = 'TheTable'))
BEGIN
    --Do Stuff
END

```

Ugly as all hell but it is what it is.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 15, 2021, 6:21pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011/3 "2021-09-15T18:21:15Z")

</div>

IMO, It’s cleaner than the first one. At least, as clean as Microsoft ever makes things…

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 15, 2021, 6:24pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011/4 "2021-09-15T18:24:57Z")

</div>

Yea both are ugly, at least the second one isn’t redundant and is a little clearer semantically. This project has been in production for very long, and a quick search revealed the second way is used all over the place, so thems the breaks for me.

The big ball of mud just got bigger.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 17, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/way-to-do-an-overlay-opt-out-on-a-sql-binding-in-vision-7-9-9/51011/5 "2021-09-17T19:20:49Z")

</div>

> [@JordanCClark](#):
>
> as clean as Microsoft ever makes things

Information\_Schema is part of the SQL standard. Microsoft effectively _ **had** _ to implement it.
