# Stored Procedure-\>string length

**URL:** <https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110>\
**Category:** Ignition\
**Created:** [November 20, 2019, 2:16pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110 "2019-11-20T14:16:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregsachs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gregsachs](https://forum.inductiveautomation.com/u/gregsachs)\
**Post date:** [November 20, 2019, 2:16pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110/1 "2019-11-20T14:16:12Z")

</div>

I’m trying to do a stored procedure with defined nvarchar outputs.  
I’ve run into the issue that if I declare the procedure using nvarchar(x) outputs, I get an error “string or binary data truncated”. If I declare the procedure using nvarchar outputs, it works, but I get a single character(as it should). It seems as though Ignition isn’t respecting the output length parameter definition, or the tag that it is targeting isn’t able to expand. My outputs are memory tags, type string.  
I’m using ignition 7.9.8, SQL Express 2014, and the MS SQL JDBC driver 7.4  
Any suggestions are appreciated.

---

<div class="post-metadata">

**Author:** ![gregsachs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gregsachs](https://forum.inductiveautomation.com/u/gregsachs)\
**Post date:** [November 20, 2019, 5:58pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110/2 "2019-11-20T17:58:12Z")

</div>

Update, I’m even more confused. I get string or binary data truncated even on a simple script operation,  
as follows:  
Database has two int columns, station and station\_id, in the table aa\_station  
Doing the very simple script below:  
query = “update AA\_Station set Station=55 where station\_ID=22”  
system.db.runPrepUpdate(query)  
also gives the string or binary data truncated.

---

<div class="post-metadata">

**Author:** ![gregsachs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gregsachs](https://forum.inductiveautomation.com/u/gregsachs)\
**Post date:** [November 22, 2019, 2:39pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110/3 "2019-11-22T14:39:19Z")

</div>

Ok, I’ve updated to 7.9.12, and created a debugging SP that just gets a single string parameter in, set as nvarchar(300) on the declaration. I still get the 'string or binary data truncated error".  
How do I debug this? How do I see the query that the transaction group is preparing to understand what is going on?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 22, 2019, 4:37pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110/4 "2019-11-22T16:37:39Z")

</div>

You should get in contact with support, if you’re not already. Stored procedure preparation is somewhat opaque - it’s handled by JDBC and the individual JDBC drivers, for the most part, but if nothing else we can see whether a different version of the driver works properly.

---

<div class="post-metadata">

**Author:** ![gregsachs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gregsachs](https://forum.inductiveautomation.com/u/gregsachs)\
**Post date:** [November 22, 2019, 4:57pm UTC](https://forum.inductiveautomation.com/t/stored-procedure-string-length/30110/5 "2019-11-22T16:57:03Z")

</div>

Thanks Paul, I did do a support e-mail on Tuesday. Just sent a reply as well.
