# Toad SQL Server running fine manually, with automated way giving error

**URL:** <https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854>\
**Category:** Toad for SQL Server\
**Created:** [June 19, 2019, 11:04pm UTC](https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854 "2019-06-19T23:04:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anubhav.singh](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anubhav.singh](https://forums.toadworld.com/u/anubhav.singh)\
**Post date:** [June 19, 2019, 11:04pm UTC](https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854/1 "2019-06-19T23:04:56Z")

</div>

Script is running fine when triggering manually. But failing while running through Task Scheduler.

Error Message:  
Set\_Variable\_1 - Object reference not set to an instance of an object.

sometime: If\_1 - The following variables are not assigned values:  
Count

Count is SQL, how to assigned values to count then

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [June 20, 2019, 3:38am UTC](https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854/2 "2019-06-20T03:38:43Z")

</div>

Have you defined a variable named count in your script and set the value? See [https://blog.toadworld.com/2013/07/24/toad-data-point-automation-series-blog-12-variables](https://blog.toadworld.com/2013/07/24/toad-data-point-automation-series-blog-12-variables)

---

<div class="post-metadata">

**Author:** ![anubhav.singh](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anubhav.singh](https://forums.toadworld.com/u/anubhav.singh)\
**Post date:** [June 20, 2019, 6:08am UTC](https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854/3 "2019-06-20T06:08:56Z")

</div>

Debbie, Somehow I am not able to fix this issue. Could you please look into SR Number:4529029. I attached the screenshot there. Hope that will give more information. Please assist in fixing this issue.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [June 20, 2019, 12:56pm UTC](https://forums.toadworld.com/t/toad-sql-server-running-fine-manually-with-automated-way-giving-error/46854/4 "2019-06-20T12:56:26Z")

</div>

Sure. I can look at the support case. Can you send the automation script and any dependent files? Also generate a support bundle from the help menu and send that also. Tell the support person when they get those files to open a subcase and email me when open. I am not normally watching the Toad for SQL Server support cases.
