Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS GETDATE() expression returning null or blank value

$
0
0

Using SQL2008 SP3, I have an SSIS package that uses an SQL Task. Within it, I have the following expresion to get the current date and time and insert it in a table:

SUBSTRING((DT_WSTR, 50) GETDATE(), 1,  FINDSTRING((DT_WSTR, 50) GETDATE(), ".",1) -1)

it works great 99.9% of the time, yet once in a while, I get the following error message when evaluationg this expression:
The length -1 is not valid for function "SUBSTRING". The length parameter cannot be negative. Change the length parameter to zero or a positive value.

So, my guess is that on that run the GETDATE() function returned null or blank or something that was not able to be used by the SUBSTRING function.

Any ideas what could be wrong? Is it just a hick up in the system?

Thanks so much for your feeback.


Paulino


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>