Wednesday, 25 November 2009

SQL Syntax to SSIS Expression Syntax

Expressions are a very powerful way to build flexibilty into packages, however people (like me) who have come from a SQL database background into developing SSIS packages often struggle to get to grips with the syntax used in SSIS expressions.

Here I have noted some SQL syntax and the SSIS expression equivalent:

SQL
SSIS Expression
AND
&&
OR
||
=
==
<>
!=
ISNULL()
ISNULL()
IS NOT NULL
!ISNULL()
CHARINDEX()
FINDSTRING()*
CONVERT(DateTime, '2007-12-04')
(DT_DATE)”2007-12-04”

*Both functions return the location of the occurence of the character, however CharIndex starts from a specified location, whereas FindString looks for the specified occurrence of the string/character. 

Helpfully, many functions are the same between the two languages, for example GETDATE() and LTRIM() work in exactly the same way in expressions as in SQL.

No comments:

Post a Comment