MMartin1 (10/31/2014)
Vimal Lohani (8/17/2014)
I didn't find any error with the code :DECLARE @i TABLE( mychar VARCHAR(50)
,deriv as SUBSTRING(mychar,1,3) --Use this
,newderiv as left(mychar,3));--Or use this
INSERT @i VALUES ('Steve'), ('Stephan'), ('Stephanie')
, ('Sterling'), ('Steppenwolf'),('Ab'),('Abc')
SELECT * FROM @i
--RESULT :
(7 row(s) affected)
mychar deriv newderiv
-------------------------------------------------- ----- --------
Steve Ste Ste
Stephan Ste Ste
Stephanie Ste Ste
Sterling Ste Ste
Steppenwolf Ste Ste
Ab Ab Ab
Abc Abc Abc
(7 row(s) affected)
You're running the above script in management studio. The question deals with the derived column SSIS transformation (used inside a data flow task). I also dont have the LEFT function here in SSIS 2008 either. So it must have come later.
Please use substring.
Vimal LohaniSQL DBA | MCP (70-461,70-462)==============================The greatest barrier to success is the fear of failure ** Success is a journey not a destination**Think before you print, SAVE TREES, Protect Mother Nature