# This might be a quick answer... Has anyone generated a BAQ from SQL code?

**URL:** <https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143>\
**Category:** Kinetic ERP\
**Tags:** baq\
**Created:** [October 18, 2023, 11:38am UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143 "2023-10-18T11:38:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaylorLemma](https://www.epiusers.help/letter_avatar_proxy/v4/letter/t/a9adbd/32.png) [@TaylorLemma](https://www.epiusers.help/u/TaylorLemma)\
**Post date:** [October 18, 2023, 11:38am UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/1 "2023-10-18T11:38:22Z")

</div>

I want to create a bunch of new BAQs, and my expertise is in SQL. Has anyone been able to copy and paste their code from SSMS into a query-builder to create new BAQs that way? It might be a reach. I really don’t want to manually build all of these connections when I can just type them out in SQL.

---

<div class="post-metadata">

**Author:** ![aosemwengie1](https://www.epiusers.help/user_avatar/www.epiusers.help/aosemwengie1/32/95533_2.png) [@aosemwengie1](https://www.epiusers.help/u/aosemwengie1)\
**Post date:** [October 18, 2023, 11:41am UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/2 "2023-10-18T11:41:36Z")

</div>

Not possible. Many here share your pain.

---

<div class="post-metadata">

**Author:** ![TaylorLemma](https://www.epiusers.help/letter_avatar_proxy/v4/letter/t/a9adbd/32.png) [@TaylorLemma](https://www.epiusers.help/u/TaylorLemma)\
**Post date:** [October 18, 2023, 11:43am UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/3 "2023-10-18T11:43:30Z")

</div>

ouch my soul hurts. Thank you for your quick reply 🥲

---

<div class="post-metadata">

**Author:** ![kananga](https://www.epiusers.help/user_avatar/www.epiusers.help/kananga/32/80812_2.png) [@kananga](https://www.epiusers.help/u/kananga)\
**Post date:** [October 18, 2023, 4:05pm UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/4 "2023-10-18T16:05:04Z")

</div>

Not impossible! Not easy though. 7zip into a BAQ export file and snoop around. It’s all text, nothing’s obfuscated. A persistent person could do a little digging into what’s necessary and what isn’t and sort out the required syntax.

An extremely persistent cloud user could even pull `Ice.ZDataField` and `Ice.ZDataTable` and use that to give a text editor some intellisense clues. Can you tell it’s crossed my mind?

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [October 18, 2023, 4:14pm UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/5 "2023-10-18T16:14:36Z")

</div>

> [@kananga](#):
>
> A persistent person could do a little digging into what’s necessary and what isn’t and sort out the required syntax.

The amount of effort required to parse SQL backwards into an Epicor Dynamic Query Dataset is pretty much like writing a SQL compiler you’d have to split and parse all the individual pieces of the SQL Syntax and somehow map over the equivalent pieces in dataset like an assembler. I do not know how an effort like this would ever be worth it specially when you can just learn to use the tool which is pretty powerful.

Having written an actual compiler a couple of times in my life all I have to say to this is… #NoThanks 😓

---

<div class="post-metadata">

**Author:** ![aosemwengie1](https://www.epiusers.help/user_avatar/www.epiusers.help/aosemwengie1/32/95533_2.png) [@aosemwengie1](https://www.epiusers.help/u/aosemwengie1)\
**Post date:** [October 18, 2023, 4:22pm UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/6 "2023-10-18T16:22:03Z")

</div>

Surely that’s more work than just writing the BAQ??? I know its painful but its not THAT painful.

---

<div class="post-metadata">

**Author:** ![jtownsend](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/f14d63/32.png) [@jtownsend](https://www.epiusers.help/u/jtownsend)\
**Post date:** [October 18, 2023, 4:50pm UTC](https://www.epiusers.help/t/this-might-be-a-quick-answer-has-anyone-generated-a-baq-from-sql-code/108143/7 "2023-10-18T16:50:03Z")

</div>

> [@TaylorLemma](#):
>
> I want to create a bunch of new BAQs, and my expertise is in SQL. Has anyone been able to copy and paste their code from SSMS into a query-builder to create new BAQs that way?

No, but in my experience, if you have mapped the query out in SQL it’s usually pretty quick to build the BAQ in the UI. Main pain point is that T-SQL supports things that BAQ doesn’t and you have to refactor. That discrepancy also makes a copy-paste approach difficult.
