Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


mike1000
2010-11-17T19:03:29Z
Hi,

I'm having the same problem as the person in an old thread here:

http://www.visualcron.co....aspx?g=posts&m=6440 

I've got a SQL Notification which gets called when a task fails. It calls a stored procedure with a number of parameters, but text is being truncated if I use variables.

For example:

SQL Notification parameters
GroupName: MyReallyLongGroupName
JobName: {JOB(Active|Name)}
TaskName: {TASK(Active|Name)}

This inserts a record like this:

GroupName: MyReallyLongGroupName
JobName: AVeryVeryLongJobNa
TaskName: MyReallyLongTaskNam

I *think* what VisualCron is doing is truncating the *results* of the formulas to the length of the formula string:

JobName parameter
"{JOB(Active|Name)}" - 18 characters
"AVeryVeryLongJobNa" - 18 characters
123456789012345678

TaskName parameter
"{TASK(Active|Name)}" - 19 characters
"MyReallyLongTaskNam" - 19 characters
1234567890123456789

Sponsor
Forum information
mike1000
2010-11-17T19:08:23Z
Quick update: As soon as I posted I figured out a messy workaround - add a load of spaces to the end of the formula in the parameter value field.

For example, instead of

JobName parameter
"{JOB(Active|Name)}" - 18 characters
"AVeryVeryLongJobNa" - 18 characters

use

"{JOB(Active|Name)} " - 30 characters
"AVeryVeryLongJobName " - 30 characters

The down-side is the value sent to the SQL Server has a load of extra spaces padded on the end. I've added a TRIM in my stored procedure, but it would be nice if it could be fixed in VisualCron.

Cheers,

M
Support
2010-11-17T20:58:25Z
Mike,

is the SQL Task working as expected - I mean, is it only the SQL Notification that is failing?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mike1000
2010-11-17T21:25:09Z
Hi Henrik,

Sorry - the title of my first post was a bit ambiguous. I've only encountered the problem in SQL Notifications. I haven't used any SQL Tasks so I don't know whether the same problem occurs there or not.

Thanks,

Mike
Support
2010-11-17T21:44:20Z
Is it possible for you to verify that. It would help us a lot.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mike1000
2010-11-17T21:53:23Z
I'm out of the office now until next Monday. I can do it then though.

Are you able to reproduce the behaviour on your machines, out of interest?

M
Support
2010-11-17T22:00:41Z
It takes time to prepare the same setup and it would save time from developers if they can compare the code (if the problem is only in Notification). For that reason, we rather wait with testing until we can pinpoint the problem.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mike1000
2010-11-17T22:07:38Z
Ok. No problem.

I'll let you know how I get on on Monday.

For reference, the steps I took to produce this are:

1) Create a stored procedure on a SQL Server which takes an nvarchar parameter and writes it to a table in the database.

2) Define a connection to the SQL Server in VisualCron.

3) Define a SQL Notification which calls the stored procedure in (1), and add a parameter with the following formula: "{TASK(Active|Name)}"

4) Create a task with a name longer than 20 characters.

5) Add the SQL notification created in (3) to the "task started" event for the task created in (4)

6) Run the task created in step (4)

If you inspect the database table you'll find the records are truncated to 19 characters (the length of "{TASK(Active|Name)}".
Support
2010-11-17T22:08:11Z
Thanks for the info.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mike1000
2010-11-22T10:29:23Z
Hi Henrik,

I've run a SQL Task with a stored procedure and it's doing the same thing.

I tried the following:

Parameter formula: "{JOB(Active|Name)}"
Job Name: "AVeryVeryLongJobName"
Result in SQL table: "AVeryVeryLongJobNa"

Parameter formula: "{JOB(Active|Name)}0123456789012345"
Job Name: "AVeryVeryLongJobName"
Result in SQL table: "AVeryVeryLongJobName01234567890123"

Parameter formula: "012345{JOB(Active|Name)}"
Job Name: "AVeryVeryLongJobName"
Result in SQL table: "012345AVeryVeryLongJobNa"

SQL Profiler shows the following query for the 3rd example above:

exec ScheduledTask.LogTaskStartEvent @GroupName=N'',@JobName=N'012345AVeryVeryLongJobNa',@TaskName=N'test',@StartDate=N'22 Nov 2010 09:27:20',@ProcessId=N'3443ef03-58a7-4dd4-8c71-12eae'

It looks VisualCron is expanding the formula correctly, but it's then truncating the calculated value to the length of the original *formula* string before it gets sent to the sql server.

Hope this helps.

Mike
Support
2010-11-23T21:42:07Z
Thanks for all information. This is now fixed for next version.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2010-11-23T23:05:06Z
mike1000
2010-11-24T02:05:30Z
Thanks Henrik,

I'll install the update and let you know how I get on with it.

Cheers,

Mike
mike1000
2010-11-24T13:59:47Z
I've given 5.7.0 a go and it seems to have resolved the problem above.

Thanks for the quick turnaround on getting it fixed. Keep up the good work 🙂.

Cheers,

M
Scroll to Top