# SCOPE\_IDENTITY FROM INSERT to Variable

**URL:** <https://forum.inductiveautomation.com/t/scope-identity-from-insert-to-variable/24861>\
**Category:** Ignition\
**Created:** [May 9, 2019, 11:26pm UTC](https://forum.inductiveautomation.com/t/scope-identity-from-insert-to-variable/24861 "2019-05-09T23:26:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juang](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@juang](https://forum.inductiveautomation.com/u/juang)\
**Post date:** [May 9, 2019, 11:26pm UTC](https://forum.inductiveautomation.com/t/scope-identity-from-insert-to-variable/24861/1 "2019-05-09T23:26:24Z")

</div>

Trying to find out if i can pass the SELECT SCOPE\_IDENTITY FROM AND INSERT QUERY to a Variable, or if this can only be than with Store Procedures… I currently have all my code that require SCOPE\_IDENTITY with SP, but i don’t know if there is way to do it without the SP.

Essentially i have insert into Table 1, then i want SCOPE\_IDENTITY, to be user in another insert to another table on the same transaction.

Thanks
