Derived Column From A Condition Statement
I've found that there is no such thing as a Case Statement in the Derived Column task in the data flow objects. I've written a ternary statement instead. I can't seem to get it to work exactly how I want it to. For example
AccountCategory == "E" ? 1 : 2
Works fine but the following doesn't
AccountCategory == "E" ? CreditAmount : DebitAmount
The CreditAmount and DebitAmount Fields are spelled correctly, the field type of AccountCategory is String and the Field type of CreditAmount and DebitAmount is numeric, but that seems to be the same situation that I have in the first example that works. Am I missing something? I'd appreciate any advice anyone has to offer. Thanks,
Bill
View Complete Forum Thread with Replies
Related Forum Messages:
Can A Column Be Derived Using Substring But The Parameters Are A Result Of A Select Statement?
I have a table which has a field called Org. This field can be segmented from one to five segments based on a user defined delimiter and user defined segment length. Another table contains one row of data with the user defined delimiter and the start and length of each segment. e.g. Table 1 Org aaa:aaa:aa aaa:aaa:ab aaa:aab:aa Table 2 delim Seg1Start Seg1Len Seg2Start Seg2Len Seg3Start Seg3Len : 1 3 5 3 9 2 My objective is to use SSIS and derive three columns from the one column in Table 1 based on the positions defined in Table 2. Table 2 is a single row table. I thought perhaps I could use the substring function and nest the select statement in place of the parameters in the derived column data flow. I don't seem to be able to get this to work. Any ideas? Can this be done in SSIS? I'd really appreciate any insight that anyone might have. Regards, Bill
View Replies !
Cast/Convert Mmddyy In String To New DB_DATETIMESTAMP Column In Derived Column Transformation
Hi, I have dates in "mmddyy" format coming from the sources and they are older dates of mid 80s like 082580 for instance. When I cast it this way (DT_DBTIMESTAMP) Source_Date , It says ok but throws a runtime error. When I hardcode a date in same format, (DT_DBTIMESTAMP) "082580" , It becomes red (an indication of syntax error) . Please note that we use double quotes in expressions in Derived Column Transformation; So an anticipation that using double quotes over single ones would be the syntax problem would be wrong. Any help in this will sincerely be appreciated. Thanks
View Replies !
Derived Column Usage When Column Does Not Exist In Source (but Exists In Destination)
Posted - 09/10/2007 : 15:53:26 Hey all - got a problem that seems like it would be simple (and probably is : ) I'm importing a csv file into a SQL 2005 table and would like to add 2 columns that exist in the table but not in the csv file. I need these 2 columns to contain the current month and year (columns are named CM and CY respectively). How do I go about adding this data to each row during the transformation? A derived column task? Script task? None of these seem to be able to do this for me. Here's a portion of the transformation script I was using to accomplish this when we were using SQL 2000 DTS jobs: '********************************************************************** ' Visual Basic Transformation Script '************************************************************************ ' Copy each source column to the destination column Function Main() DTSDestination("CM") = Month(Now) DTSDestination("CY") = Year(Now) DTSDestination("Comments") = DTSSource("Col031") DTSDestination("Manufacturer") = DTSSource("Col030") DTSDestination("Model") = DTSSource("Col029") DTSDestination("Last Check-in Date") = DTSSource("Col028") Main = DTSTransformStat_OK End Function *********************************************************** Hopefully this question isnt answered somewhere else, but I did a quick search and came up with nothing. I've actually tried to utilize the script component and the "Row" object, but the only properties I'm given with that are the ones from the source data. thanks in advance! jm
View Replies !
Derive A Column Based On Other Derived Column In A Table .. Is It Possible ?
Table structure as follows Employee Empno empname salary commission I want to have an other employee table named employee_modified Empno empname salary commission derived_column1(salary+commission) derived_column2(derived_column1 + xxxx) and so on derive other columns based on the earlier derived columns) Is that possible to do it.. or am I doing something wrong. something like Select empno , empname , salary , commission, (salary + commission) as derived_colum1 , (derived_colum1 + xxxxx) as derived_colum2 , (derived_colum2 + xxxxx) as derived_colum3 into employee_modified from employee
View Replies !
Add Values To A Column With Derived Column Expression?
Hi, how are you? I'm having a problem and I don't know if it can be solved with a derived column expression. This is the problem: We are looking data in a a sql database. We are writting the SQL result in a flat file. We need to transform data in one of the columns. For example: we can have 3 digits as value in a column but that column must be 10 digit length. So we have to complete all the missing digits with a zero. So, that column will have the original 3 digits and 7 zeros. How we can do that tranformation? We must do it from de the flat file or it can be a previous step? Thanks for any help you can give me. Regards, Beli
View Replies !
Like Condition In Sql Statement
This is my sql query Select DOJ AS 'JoiningDate' from emp where DOJ like '%2008/09/04%' there are 8 records on this time.But it displays no result . The column is datetime datatype year month date or we need to mention any thing other than this.
View Replies !
Hi, How Could Put A Condition In Statement.
Hi, i wanted to put a condition based on my codes below.. but where i had to put the condition? like where QTY=3 please help.. INSERT INTO magpatoc.dbo.RSOTransfer(RSONO, Customer, ItemCode, ItemDescription, Source, MOQ, QuantityRequired, Remarks, ZeroStock, NewProduct, ProjectForecast, WithMotherPO, Other, RequestedBy, RequestedDatetime, NotedBy, RecievedBy, RecievedDatetime, PreparedBy, PreparedDatetime, ApprovedBy, ApprovedDate, ReservationNoDate, PurchaseOrderNo) SELECT * FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0','c:CopyOfRSODB.mdb';'admin';'',FinalCustItemRSO) ed9teenMagnaza
View Replies !
If Condition In Select Statement...
Hi, I need to write an if condition in SELECT statement. Below is the code for the same. But its throwing error. Can some refine the code below. SELECT tblCustomer.Customer_LegalName, (IF (tblCustomer.IsNRACustomer = TRUE) SELECT tblCustomer.Customer_PassportNo ELSE ISNULL(tblCustomer.Customer_TaxId, tblCustomer.Customer_PassportNo)) AS TAXID, tblCustomer.Customer_DoingBusinessAs, tblSeed_EDDCategory.CategoryName, '2' AS DCS, tblUser_OfficerCode.User_OfficerCode, tblCustomer.Customer_AreaId, tblCustomer.Customer_BranchId, CONVERT(VARCHAR(11), tblCustomer_EDDCategory.CreateDate) AS CreateDate, tblSeed_EDDCategory.EDDCategoryId, tblCustomer_EDDCategory.Category_CreateEmpId, tblCustomer_EDDCategory.CustCatId, tblCustomer.Customer_Id, tblSeed_Area.AreaName, tblSeed_Employee.Name, tblUser_OfficerCode.User_OfficerName, tblCustomer.Customer_TaxId, tblCustomer.IsNRACustomer, tblCustomer.Customer_PassportNo FROMtblCustomer INNER JOIN blCustomer_EDDCategory ON tblCustomer.Customer_Id = tblCustomer_EDDCategory.CustomerId INNER JOIN tblSeed_EDDCategory ON tblCustomer_EDDCategory.EDDCategoryId = tblSeed_EDDCategory.EDDCategoryId INNER JOIN tblSeed_Employee ON tblCustomer.Customer_CreateEmpId = tblSeed_Employee.EmployeeId INNER JOIN tblUser_OfficerCode ON tblCustomer.Customer_CreateEmpId = tblUser_OfficerCode.EmployeeId INNER JOIN tblSeed_Area ON tblCustomer.Customer_AreaId = tblSeed_Area.AreaId Thanks, Rahul Jha
View Replies !
'IF' Condition On Select Statement?
Can you implement the same type of feature in SQL as MS Access uses with it's "immediate if" or iif() function? In other words can you look at a specific row and change the contents of one field based on the contents of another field in the same row? I am trying to create a view like the the following: CREATE VIEW AS Test SELECT name, city , IF city = 'NY' state ELSE country FROM address_table The view's 3rd field will be either [state] or [country] depending on the contents of [city] Thanks in advance! ..Marisa
View Replies !
Need Help On Select Statement Wit Like Condition
I tried following code and it return no data after query run successfully. I m testing it on msaccess . SELECT Book.ID, Book.Title, Book.Arthor, Book.Publisher, Book.Year, Book.Price, Inventory.B_ID, Inventory.Quantity FROM Book INNER JOIN Inventory ON Book.ID=Inventory.B_ID WHERE Book.ID=Inventory.B_ID And ("Book.Arthor" Like '%es%'); ------- I have test and test2 in Arthor column ... Thanks all !!
View Replies !
Condition In Select Statement
col1 col2 col3 col4 36930.60 145 N . 00 17618.43 190 N . 00 6259.20 115 N .00 8175.45 19 N .00 18022.54 212 N .00 111.07 212 B 100 13393.05 67 N .00 In above 4 col if col3 value is B then cursor has to fectch appropriate value from col4. if col3 value is N then cursor has to fectch appropriate value from col1. and also wants the sum of result above conditions when column 3 has two values(i.e N,B) for single col2 value here col2 values are unique take an example for col2=212 if col3=B then result is 100 if col3=N then result is 18022.54 for a single col 2 value ,if col3= N and B then we want sum of above 2 conditions i.e (100+18022.54) but not the sum of (100+18022.54+111.07+0.0) . Can any one reply for this..............
View Replies !
WHERE Condition In SELECT Statement
Hi All, I want get the result in a single SELECT statement SELECT SUM (PAID_LOSS), SUM (PAID_EXP) GROUP BY COMPANY FROM VIEW_POLICY WHERE Accounting_Period GE 200701 and LE 200712 -************************************ SELECT SUM (MEDICAL_RESERVE) GROUP BY COMPANY FROM VIEW_POLICY WHERE Accounting_Period LE 200712
View Replies !
UPDATE Statement With A JOIN Condition
Hi all, HERE IS MY UPDATE STATEMENT: Update WACTS_Inventory_Part_Loc_Tbl SET WIPLT_Part_New_Qty = WIPLT.WIPLT_Part_New_Qty + tmp.MATIN_QTY FROM WACTS_Inventory_Part_Loc_Tbl WIPLT INNER JOIN Temp_MatIn_Data tmp ON WIPLT.WIPLT_Part_Number_MSBA=tmp.PARTS_ShortID WHERE WIPLT.WIPLT_Location_Code='MF' I have a Problem with this satment becoz my Temp_Matin_Data_Tmp table contains two records with the same PartNumber that is (ShortId) and the two records have two different quantities. The WACTS_Inventory_Part_Loc_Tbl has only one Part NUmber Record and the key is the PartNUmber and Location_Code. Now when the Update Satement runs it updates the qty only from the first record of the temp table and does not update the quantity of the second record from tne source table. I woould appreciate any help on this. Thanks, Jothi
View Replies !
Deriving A New Column From Another Derived Column
In a Derived Column data flow transformation, why can't I refer to a derived column (added in that same transformation) in the expression for another derived column? It seems I am forced to chain 2 DC data flows, just to do something as conceptually simple as: a = x + y; b = a² On a related note: Can I define a variable that is scoped to each row? Can I bind a variable in an expression to avoid creating a new row, e.g. let a = x + y; a² as the expression for new row b?
View Replies !
Calculating Column W/ Another Derived Column
Can someone help me with the following query? I need to take the derived value from one column and calculate another column with it. SELECT UserID, ((SELECT COUNT(*) FROM HPN_LeadMatches)+(SELECT COUNT(*) FROM HPN_Painters)) As Total, (SELECT COUNT(*) FROM HPN_Leads) / Main.Total FROM HPN_LeadMatches As Main The error i'm getting says is unkown column 'total'. Is there another way to accomplish this? Thanks!!
View Replies !
How Does One Column Condition Fire Other Column
hi guyz, i am having a doubt. The problem i am facing is tht i have a table in which one column is a condition column and other column is action column. Now how can i give a condition such that if the condition is true the action must be fired. This is like a if statement ...where if the condition is true the corresponding action in the table has to be fired Can someone help me with this Sama
View Replies !
How To Put Condition In Select Statement To Write A Cursor
col1 col2 col3 col4 36930.60 145 N . 00 17618.43 190 N . 00 6259.20 115 N .00 8175.45 19 N .00 18022.54 212 N .00 111.07 212 B .00 13393.05 67 N .00 In above 4 col if col3 value is B then cursor has to fectch appropriate value from col4. if col3 value is N then cursor has to fectch appropriate value from col1. here col2 values are unique. Can any one reply for this..............
View Replies !
Derived Column
I have two columns made up of 4 digits numbers eg col1 1234, col2 9876 I want to create a derived column so i get a eight digit column, eg col3 12349876 I cannot seem to get the expression right, I seem to be always adding the value which i do not want, can someone help me out with the expression Thanks Robbie
View Replies !
Derived Column
I am trying to create a derived column from two separate fields. One is a date field in format of 2008-03-01 and one is a time field. In DTS I use to have something like this: DTSDestination("TransactionDate") = cdate(DTSSource("DSRHDATI")) & " " & timevalue(DTSSource("DSRHTIME")) I am trying to figure out how to do this in SSIS. I know I have to use a dervived column but can't seem to come up with the correct syntax. Any help would be apprecaited. thanks. Stacy
View Replies !
Derived Column
I am trying to transfer data from SQL Server 2005 table to another SQL Table. In the source table there is a field called Region [nvarchar(max)]. The values for these fields will be like APAC-China, NA-Racine, etc., i.e Region followed by the country name seperated by - symbol. I want the destination tablre with 2 fields Region[nvarchar(max)] and Country [nvarchar(max)]. I am using a Derived Column task to achieve the same. Can anyone please help me out in doing this data conversion? Thanks
View Replies !
Derived Column
Hi, I am doing a task which will get all data based on several base and crosswork tables. I used stored procedure to get the data, but the next step will be using derived column to massaging data, and to load to the destination database. Is there a way to do that since I must generate data on the fly? Thanks, Megan
View Replies !
Derived Column Help
Hi Guys, How can i put in a derived column the value of 3 columns? I've tried these: [MyId]+[Paper1] "[MyId]+[Paper1]" but no luck. How can i put it right? Thanks Gemma
View Replies !
Derived Column
Hi, wondering if anyone can help me. I currently have a field that has a date and time in it in the format dd/mm/yyyy hh:mm:ss. Ideally I would like to get rid of the time part of it altogether but for it to still be recognised as a date as opposed to a string. However, I've been told that this is not possible in 2005, is this true? If this is the case, what would be the best way to set the time to 00:00:00 after the date for all records on that field?
View Replies !
Bcp Into View With Derived Column
Hi,I have a view that looks something like this -CREATE VIEW myview AS SELECTmyudf(col1) as col1, col2, col3FROM mytableThe view has an 'INSTEAD OF' trigger on it to do the correct thing oninsert. When I run the bcp, it runs successfully, but the valueinserted into col1 is always NULL. I modified my trigger to get abetter idea of what was happening, and when I look at the values ofINSERTED.col1, they are all null. It appears that bcp is setting thecolumn value to null, presumable because the view definintion for thiscolumn is a derived column.Does any one know a way around this?Thanks!
View Replies !
Conditional On A Derived Column
Hi everyone, I have a quizzing application where users log in, answer questions, and are ranked relative to each other. For this final ranking, I calculate their score using this formula - score = (correct Qs answered) * 150 / (total Qs answered) + (total Qs answered) The SQL query that i use to get this info is - Code: SELECT TOP 50 username, (sum(correct) * 150 / count(1) + count(1)) AS score, count(1) as totalq FROM questionsstats GROUP BY username ORDER BY score DESC This works just fine. However, on top of this I need to put an additional restriction that only users who have at least answered 20 questions be counted in. How can I do this? Adding a simple 'WHERE totalq > 20' does not work. I get the error "Invalid column name 'totalq'.". Surely there must be a simple way to do this? Thanks.
View Replies !
Problem In A Derived Column
Dear Friends, I have an derived column in an ETL, that use the DateDiff function. The experssion of the derived column is: DATEDIFF("d",RKData,MaturityDate) / 365 The problem is that the result always come as an integer, and in fact the result of the expression usually has decimal numbers.. :-( I defined the new colum of derived column as doube-precison float [DT_R8].... Someone help me? Thanks!
View Replies !
Help Me With Derived Column Transformation
I have this expression (Registered_Units == Limited_Units) ? 0 : (Painted_Units / (Registered_Units - Limited_Units)) * 100) It gives me 0.00, although those 3 columns have values. if I cast it like this (Registered_Units == Limited_Units) ? 0 : ((((DT_DECIMAL,2)Painted_Units) / ((DT_DECIMAL,2) (Registered_Units - Limited_Units))) * 100) It gives me correct answer in whole number but .00 after decimal. Any clue how to fix it ?
View Replies !
Derived Column Problem
I want to implement all this four condition in one derived column expression. if (Column1== 1) { OutputColumn = ColumnA- Column1RATE } if (Column2 == 1) { OUtputColumn = ColumnA- Column2RATE } if (Column3 == 1) { OUtputColumn = ColumnA- Column3RATE } if (Column4 == 1) { OUtputColumn = ColumnA- Column4RATE } please suggest
View Replies !
Derived Column Comparison
I am importing States into a table and need to change all NULL fields before I perform a lookup. I'm using a derived column to replace the state value. I'd like to find all States that are blank and set it to "--". Ironically, this works: State != "" ? State : "--" but State == "" ? State : "--" Does not work Can someone tell me why?
View Replies !
Derived Column Or Script
Dear All, I am pretty new to SQL2005 technologies. I have a table like this: Name Code Peter 10 Eric 20 I am interested in translation of the €œcode€? to €œjob role€?: Name Code Job role Peter 10 Director Eric 20 Consultant I have tried to use Derived Column and also script €“ but I am unable to get it to work. Any hints/solution would greatly appreciate. Best Regards, T
View Replies !
Getting User Name In A Derived Column
Hi there, is there a way that I can set the value of a column to the currrent user in a derived shape? For instance if I want to set the value of a column to the current data I can merely use GETDATE(). What is the current user equivilent? Thanks
View Replies !
Derived Column Calculation
Example: (47 / 204709) * 12000 = 2.754 Both values (47 & 204709) are of data type Int. SQL Sever - Derived Column Calculation returns 2.74 The destination data type is Float I have converted the data types to Float, Decimal & Numeric and still got the same answer. Any suggestions
View Replies !
Derived Column In XML Datatype
Hi, I have a data flow task where I have mutiple columns (of different data types) , I want to create a single column using all these columns in XML format and load it into a table with a column of datatype XML. Can I accomplish this using Derived column tranformation? Thanks
View Replies !
Derived Column Error
Hi, I have just started learning SSIS. I have created a new package which is as follows : SOURCE QUERY ----> Derived Column ------> Destination Customer Info Source Fields are FirstName LastName OrgCode Phone Ref1 The Derived column is adding a new Column name FullName and the friendly expression for it is FirstName + "Null" + LastName Destination has all the columns are same as source columns with similar datatypes. When i start the debugging process i get the following error: [Destination - CustomerInfo [29]] Error: Column "FullName" cannot be found at the datasource. [Destination - CustomerInfo [29]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid. [DTS.Pipeline] Error: component "Destination - CustomerInfo" (29) failed the pre-execute phase and returned error code 0xC0202025. Please let me know where i am going wrong. Thanks
View Replies !
Divde By 100 In A Derived Column
Hi, I must be missing something in the following The original number from the flat file is 00069 With ((DT_NUMERIC,18,2)[Column 9]) in a derived column I get 69.00 Then I change the derived column to ((DT_NUMERIC,18,2)[Column 9]) / ((DT_NUMERIC,18,2)100.00) and I get 0.00 I want .69
View Replies !
Convertion In Derived Column
I have a column age ( smallint) in derived transformation .. I would likt to convert it to A or B which is char(1) hwo can i convert smallint to char(1) in derived column? age > 17 ?"A" : "B"
View Replies !
Derived Column In SSIS
Hi, I apologize if this question has already asked (I already looked in this forum but do not find the answer), I need to have this done as soon as possible. I've following data: column1 column2 begin_date active ------------- ------------ ---------------- ----------- 1253 1057 1/1/2006 0 1253 1057 1/1/2007 0 1253 1057 4/1/2007 0 1253 1057 7/1/2007 1 I need to have the final result as following: (the new end_date column is the value of the begin_date in the next row -1) column1 column2 begin_date active end_date ------------- ------------ ---------------- -------- ------------------ 1253 1057 1/1/2006 0 12/31/2006 1253 1057 1/1/2007 0 3/31/2007 1253 1057 4/1/2007 0 6/30/2007 1253 1057 7/1/2007 1 null Any ideas? Thank you!
View Replies !
Derived Column Transformation
Hello. I am using Derived Column transformation for calculating the age of individual and then adding the column to my final destination. In SQL, the DOB is varchar(50) and the output column I am creating should be Integer. Here is the expression I am using for calculating the age: (DATEDIFF("DAY",(DT_DBTIMESTAMP)TRIM(DOB),(DT_DBTIMESTAMP)TRIM([Service Date])) / 365.25) In SQL, I have no problems getting the age of a person, but I am having difficulties using Derived Column Transformation. I get the following error when executing my package: Error: 0xC0049067 at Data Flow Task, Derived Column [2086]: An error occurred while evaluating the function.Error: 0xC0209029 at Data Flow Task, Derived Column [2086]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Column" (2086)" failed because error code 0xC0049067 occurred, and the error row disposition on "output column "_AGE" (2877)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. Any assistnace would be greatly appreciated.
View Replies !
Complicated Derived Column
I have a complicated derived column. In a Crystal report it is this: if isnull( {YSA.YSAbA}) then ( stringVar accountPart1 := "1"; stringVar accountPart2; stringVar accountPart3; stringVar accountPart4; if left({YAAREP.A7KMCD},2) = 'aa' then accountPart4 := '01' else if left({YAAREP.A7KMCD},2) = 'bb' then accountPart4 := '02' else if left({YAAREP.A7KMCD},2) = 'cc' then accountPart4 := '03'; select {YAAREP.A7KNCD} case "39000": accountPart3 := "115" //this is freight case "35000": accountPart3 := "110" case "36000": accountPart3 := "105" default: accountPart3 := "105"; if "SERVICE" in {YAAREP.A7KMCD} //if MIKE RYAN then accountPart2 := "3300"; if {YAAREP.A7KNCD} = "39000" //this is freight then accountPart2 := "4300"; if cdbl({YAAREP.A7KNCD}) > 44000 then accountPart2 := left({YAAREP.A7KNCD},4); if cdbl({YAAREP.A7KNCD}) > 44000 then accountPart3 := right({YAAREP.A7KNCD},3); accountPart1 + "-" + accountPart2 + "-" + accountPart3 + "-" + accountPart4 ) else {@PrintDefaultSalesGL} How should I do this in an SSIS? Or do I need to show how do this in SQL Query? Thanks for the help!
View Replies !
Derived Attribute Column
Hello, first time here, first time messing with SQL. When creating a table in SQLServer2005 can you specify a column to be for a derived attribute. example a column monthlysalary and create a column that is a derived attribute - yearly salary. Is this done when creating the table and how is the syntax ?
View Replies !
ISNUMERIC In Derived Column
I would like to validate datatype using Derived Column.My data type are such as numeric(X,X),datetime,int, and varchar.How do I do this using Derived Column.Example if row does not qualify as ISNUMERIC()...throw it in ERROR table else send it to SUCCESS table.Any Idea ?
View Replies !
Help In Derived Column Transformation
Hi All I m designing SSIS having Data Flow as Flat File > Derived Column Transformation > Destination Table but while transfering record from text file to table i need some logic here my text file is "ID"|"Name" 1012|"10AA" 1013|"10BB" logic is 10 should be replace by variable VID = 98 I defined this veriable as int My ID column in database is int and Name column is varchar(50) I try here expression like ID != 98 ? @[User::VID] : ID it work fine but for varchar column I am not able to do I got error when i write expression SUBSTRING(Name,1,2) != "98" ? [DT_STR, 50, 1252] "(@[User::VID])" + rest of value of column : [Name] my final output in table should be like ID..Name 98..98AA 98..98BB Please help me out T.I.A
View Replies !
Derived Column Not Processing Any Records
Hi, I have built a package in which i use a derived column to create a new set of columns and then pass the same to another target transformation. The issue now what I am facing is, the re are certain number of records coming from source(16 rows) and gets processed before the Derived Column transformation, but after that, no records gets processed after the derived column transformation. The package status shows as Success, but there is no records being written in the target table. Any idea what could be the issue here? Thanks, Manish
View Replies !
Derived Column Expression Question......
Greetings, I have an existing 2000 DTS package that uses the following case statement: Case When TERMS_PERCENT ='0' then 0 else cast(TERMS_PERCENT as decimal(6,2))/100 end as TermsPct to convert a source DT_STR(4) datatype to a DT_Numeric(5,2) destination column and would like to use an equivelent derived column expression in 2005. Being a DBA by nature and experience I'm having trouble converting this statement to a valid expression without failure, any help would be greatly appreciated.
View Replies !
Question On Derived Column Expression
Hi, all experts here, Thank you very much for your kind attention. I am having a question on derived column expression. The expression I am trying to use for the derived column is as below (column1 is a numeric data type column): case when column1<0 then 'yes' else 'no' end But I got the error message though, would please any experts here give me any advices on the expression I used? What is wrong with the expression I used above? Thank you very much and I am looking forward to hearing from you shortly. With best regards, Yours sincerely,
View Replies !
Derived Column - Date Conversions?!?
It was my understanding earlier that -- it is mandatory to have a Derived Column for a DATE String in a Flat File to be loaded properly into a table with "datetime" column type However, i tried running my package with the Input Column as "DT_STR" and the Destination on the table is DATETIME. Looks like the process went on fine.. Am i missing something here? My Date Format from the source looks like -- "DD-MON-YY" Regards
View Replies !
Data Coversion Or Derived Column?
I have a numeric column with the following sample values in a source flat file: 240 6 48 310 55 I would like to dump them in a table (destination) as string with the length only 3 and in the following format "xxx" . Data in the destination column will look like this after the transformation: 240 006 048 310 055 Thanks for your help!
View Replies !
How To Check Numeric In Derived Column?
I would like to know how can i use derived column to covert the scrip that use to transformation column in DTS 2000(i've migrate my dts to ssis) i didn't know what function can check the numeric in ssis. My scrip in transformation in dts 2000 as follow. Function Main() if isnumeric(DTSSource("Col012")) then DTSDestination("SH") = int( DTSSource("Col012")) else DTSDestination("SH") = DTSSource("Col012") end if Main = DTSTransformStat_OK End Function Any suggestion please let's me know. Thanks. Best Regards, Kus
View Replies !
|