TRANSFORM MUTLIPLE COLUMNS

Jun 18, 2008

Hi all, new to SSIS so please bear with me on the noobie question:

Situation: have a SQL database with several tables, each table has several char fields that represent dates (ex. YYYYMMDDHHMMSSMS)- this SQL database is created weekly from an extract of an old Oracle RDB database maintained by a third party vendor.

Need to copy the data to a new database and tables
Then for each table:
1. check each char date column and if the value is '1858111700000000' (Oracle dummy date) then change to SQL low date, if it's not then transform the date into SQL server date format. I' ve tried some of the data controls - just need to know which ones to use and in what order.

What would be the best controls to do iterative processing in an efficiant manner? Some tables have upto 5 million rows

Any Ideas would be appreciated! Thanks!

View 5 Replies


ADVERTISEMENT

Transform Table Rows Into Columns

Feb 21, 2005

Hi guys,

I have a SQL Server 2000 table that contains a Year field and another table containing Products.

The Year table contains only a year field.

The Product table contains ProductId, Date, Quantity.

I'm trying to construct a query such that I can view the Quantity of Products by Year (derived from the Year table).

ie.

If the Year table contains the rows 2003, 2004 and 2005, the resultant query would produce the output: -

PId 2003 2004 2005
50 3 6 7
51 4 2 6
52 8 0 3

Any ideas how I can achieve this?

Cheers in advance,

Rob

View 2 Replies View Related

Advanced SQL HELP: Transform Rows To Columns

Mar 22, 2004

I have a table of 1000+ rows with 100+ different items with each Id having max 10 items

Id item
1 a
1 b
2 c
2 a
2 d
3 b
3 z

each item has an order in a different lookup table
item item_seq
a 1
b 2
c 3
d 4


The item columns (below) need to use the item order from lookup table, so the output table is as follows

Id item item2 item3
1 a b
2 a c d
3 b z

PLEASE HELP !!!

View 8 Replies View Related

OLE DB Command Transform And Output Columns.

Jan 10, 2007

Hi All,

I have an OLE DB transform with a SQL Command of:

sp_get_sponsor_parent ?,? OUTPUT

where sp_get_sponsor_parent is defined like:




CREATE PROCEDURE [dbo].[sp_get_sponsor_parent]

@pEID int,

@results int OUTPUT

AS

BEGIN


.

.

.
END

I map the columns, refresh & OK out of the component without trouble, but on executing the package it fails during validation on this component. I'm utterly stumped.
Any light shed would be greatly appreciated.
Many thanks in advance,
Tamim.

View 3 Replies View Related

Transform One Varchar Column Into Many Bit Columns

May 19, 2007

Hi all,
I'm new at this SSIS but have been able to successfully create some simple packages. My situation is that at work we use a column to describe a status of applications. However, this makes for hellacious query because some of those statuses inherintly were one or more statuses previously. Example
Admit = Admit
Accept = Admit then Accept
Withdraw Accept = Admit, Accept, then Withdraw
Decline = Admit then Decline
As you can see inherintly those were all admits at one point. So what I'd like to do is instead of having long queries for example to get all my "Admits", I'd rather query another table that has the following columns as bits:
Admit
Accept
Withdraw
That way I can query the admit column and get all my admits. How can I use SSIS to transform my "Decision" column into those bit columns?
Thanks for any help or suggestions you have.

View 13 Replies View Related

I Am Try To Read Mutliple Xml File

Feb 17, 2006

patelnimisha writes "i am try to read three xml files and transfer its data into sql databse.
so
i have no any idea about this qurey.
give me coding for this query"

View 2 Replies View Related

Insert Into Mutliple Tables - Sql Server

Sep 11, 2007

 Hi,I am trying to update a sql server 2000 database breaking up 1 huge confused table into several smaller tables to allow for more flexibilty.I want to use the "insert into" statement to create 2 new tables from the one old table. Old Table - structureCommercialProperties Cols: ID(identity) - PropName - PropAddress - Pic1 - Pic2 - Pic3New tablesPropertyCols: ID(doesn't have to be same as original id) - PropName - PropAddress PropertyImagesCols: ID - PropID(from new Property table ) - PicFile ----------------------------I know this won't work but it is to show what I want to do. I want to cycle through all the CommercialProperty rows and add the values to the new tables.I just need it to run in Query Analyzer declare @pic1, @pic2, @pic3 as varchar(255) declare @newID as integer declare @PropName, @PropAddress as varchar(255) select @PropName=PropName, @PropAddress =PropAddress , @pic1=Pic1, @Pic2=Pic2, @Pic3=Pic3 from CommercialPropertiesinsert into Property (PropName, PropAddress) values (@PropName, @PropAddress)SELECT @NewID AS [SCOPE_IDENTITY]how do I use the new Identity and to add the existing images details into the PropertyImages tableinsert into PropertyImages (PropID, PicFile)  values (@NewID, @Pic1(from the original query)insert into PropertyImages (PropID, PicFile)  values (@NewID, @Pic2)insert into PropertyImages (PropID, PicFile)  values (@NewID, @Pic3) go to next CommercialProperty  Thanks for your helpP 

View 2 Replies View Related

Query To Collapse Mutliple Rows

May 21, 2008

Hello -

I am having a difficult time trying to generate a result set that collapses multiple rows into one. However, I am also getting some of the columns that I am trying to SUM, to double their value.

I have two tables as:

Table 1
EmpID (int), AcctID (int), ActivityDate(datetime), Process (nvarchar 20), Cost (money)

Table 2
EmpID (int), AcctID (int), ActivityDate(datetime), Process (nvarchar 20), Duration (smallint)

Some sample data:
Table 1
501, 7998, 04-2-2008, Process1, $100
501, 7998, 04-2-2008, Process2, $75

Table 2
501, 7998, 04-2-2008, Process2, 3

Result i need is:
501, 7998, 04-02-2008, $175, 3

What I am getting is:
501, 7998, 04-02-2008, $175, 6

Any suggestions or help will be appreciated.

Thank you
- will

View 3 Replies View Related

Question: How To Run With Mutliple Configuration Files.

Jul 16, 2007

Hello,
Here is the scenario.
I'm using SSIS and SQL 2005

I have two dtsx packages. Lets call them TESTA.dtsx and TESTB.dtsx. I've enabled using XML package configurations on both.

TestB.dtsx pulls some data from a table and writes it to a flat file.
TestA.dtsx calls TestB.dtsx.

For the test I changed the TestB fileoutput connection string to save to a different location.


When I run TestA.DTSX using DTEXEC. TestB's configuration file is not being used.

How do I kick off TestA.dtsx and specify a package configuration for test b?

I tried manually copying the Config parameters from TESTB's config file to TESTA.

When I run TESTB directly from DTEXEC and pass in it's config file as an argument it runs fine.

View 9 Replies View Related

SQL Datasource Running The Same Query Mutliple Times

Jan 22, 2008

I have multiple SQLDatasources on multiple pages. When I call the Select command for the datasource the query is run multiple times. I was wondering if anyone had any problems like this. The data is being read into listboxes. If you need any more info or have any specific questions, feel free to ask.

View 6 Replies View Related

Returning Mutliple Strings From Stored Proc

May 14, 2007

Hey guys, could somebody pls provide me with an easy example as to how you would return multiple strings from a stored proc? Even a link to a decent tut would be great!

Muchos gracias!

View 12 Replies View Related

Single Row Result From Mutliple Table Rows?

Sep 19, 2007

Hi again,

I'd appreciate advice on the following. Thanks very much!

Given this Table:
family|product|type
fam1 |abc |XX
fam1 |def |YY

What query would return this?
Family|Type1|Type2
fam1 |xx |yy


--PhB

View 8 Replies View Related

Extract Data With Mutliple &"headers&" In 1 File

Oct 5, 2006

My query relates to that of Lightbug3 and the solution from X002548.

My query is how do I have multiple headers within the export file?

I am extracting order information using DTS whereby there is a header containing the purchase order number and the detail being the product ordered for that PONumber.

I need to start a new header for each new purchase order number.

I'm looking to create something similar to

PONumber 1
Product, qty
Product qty
PONumber 2
Product, qty
Product qty

Would be grateful for any advice.

Thanks

View 2 Replies View Related

Split The Existing MDF File Into Mutliple Files As A File Group?

Jul 30, 2007

I have a huge MDF File - 120 GB File (Had setup as 1 MDF initially) -- Did not anticipate that the DB would grow to that size!!

Anyways.. I heard that the general performance woul grow if i had them as "File Groups"..

Is there anyway - to split the existing MDF file into Mutliple files as a File Group?

Where should i start? Can someone please direct me..

View 1 Replies View Related

RS2k Issue: PDF Exporting Report With Hidden Columns, Stretches Visible Columns And Misplaces Columns On Spanned Page

Dec 13, 2007

Hello:

I am running into an issue with RS2k PDF export.

Case: Exporting Report to PDF/Printing/TIFF
Report: Contains 1 table with 19 Columns. 1 column is static, the other 18 are visible at the users descretion. Report when printed/exported to pdf spans 2 pages naturally, 16 on the first page, 3 on the second, and the column widths have been adjusted to provide a perfect page span .

User A elects to hide two of the columns, and show the rest. The report complies and the viewable version is perfect, the excel export is perfect.. the PDF export on the first page causes every fith column, starting with the last column that was hidden to be expanded to take up additional width. On the spanned page, it renders the first column on that page correctly, then there is a white space gap equal to the width of the hidden columns and then the rest of the cells show with the last column expanded to take up the same width that the original 2 columns were going to take up, plus its width.

We have tried several different settings to see if it helps this issue or makes it worse. So far cangrow/canshrink/keep together have made no impact. It is not possible to increase the page size due to limited page size selection availablility for the client. There are far too many combinations of what the user can elect to show or hide to put together different tables to show and hide on the same report to remove this effect.

Any help or suggestion on this issue would be appreciated

View 1 Replies View Related

DTS Transform

Jul 13, 2004

I get this error:

column 6 ('CheckDate', dbType_dbtimestamp), status 6: dat over flow
invalid character value for cast specification

Here is the sql generated :

CREATE TABLE [DMS].[dbo].[Master] (
[Date_Entered] smalldatetime NULL,
[Initials] nvarchar (10) NULL,
[VendorName] nvarchar (50) NULL,
[CheckNum] nvarchar (20) NULL,
[ExpenseType] nvarchar (10) NULL,
[CheckDate] smalldatetime NULL,
[CheckAmount] money NULL
)


IM guessing i need to change date_enteed type or do a cast

any help pls

!~<M

View 3 Replies View Related

Look UP Transform

Apr 10, 2008



Hi ,

i am using to Lookup transform for the matching records , if my source records are matching with lookup records it work fine , if not it through the following error


[Lookup [34]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Lookup" (34)" failed because error code 0xC020901E occurred, and the error row disposition on "output "Lookup Output" (36)" 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.



Please advice , how i can solve this .




Thanks in Advance
Raja Ragothaman

View 1 Replies View Related

DTS Transform Issue

Jun 28, 2006

I am importing data from Excel to a SQL table using a simple DTS. At times the DTS fails because one of the columns in the Excel file may have an invalid time date entry. Sometimes the time will be an invalid negative number and will cause an overflow error durring import to the SQL table column.

Is there a way to capture the data before writing it to the table and validate it and if it is invalid, or more specifically a negative nuimber, enter a default value or a null value?

If there is could you be specific in how to setup the DTS transformation script.

TIA
Jeff

View 4 Replies View Related

Transform XML From A SELECT...FOR XML

Jan 14, 2008

I want to transform elements in a XML-respons.

If I use FOR XML PATH, ELEMENTS in the SELECT-statment I get the following result:

<row>
<nr>99</nr>
<namn>test bolag</namn>
</row>
<row>
<nr>02</nr>
<namn>test bolag 2</namn>
</row>

I want to modify the elements so that they look like this insteed in the SELECT-statment.

<row>
<field name="nr">99</field>
<field name="namn">test bolag</field>
</row>
<row>
<field name="nr">98</field>
<field name="namn">test bolag 2</field>
</row>

I need to transform the resulting XML because I need to send it to a webservice with a mySQL database on the reciving end.

Please help me :-)

View 5 Replies View Related

Data Transform

Jun 22, 2008

Hi friends,
Can somebody tell me how to do this-
How can we Analyze existing code used to transform data into the Operations Data Warehouse, and make changes to correspond to upcoming changes in the SAP data sources.
Thanks

sk

View 1 Replies View Related

Transform Recordset

Jul 20, 2005

Hi,I have table where i have the following fields in datasheetview:id | date | image | question1 | question2 | question..NI would like to have it in this way:id | date | image | questionnr | answer1 01-01-2004 test.tif 1 1000 (this is the value offield question1)As you can see the first 3 fields remains the same, but the records of those3 fields should be inserted for each record of the question fields. I can dothis with a union query for each questionfield, but.....How can i do this automatically, because there are more than 500 columns.

View 1 Replies View Related

Script Transform

Jun 25, 2006

Hi,

My requirement is to check whether value of a particular column is null or not. if it is null I have to enter warning messages into the temp table I have created.

For this I am using Script Transform

Now I want to know how to write info from script transform to a table using SSIS.

Currently I am using the following code in script component

[Code]

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim ConnString As String

ConnString = "Data Source=ABC;Initial Catalog=XXXX;Integrated Security=SSPI;"

Dim sqcn As New SqlConnection(ConnString)

''Dim sqlCmd As New SqlCommand(ConnString, sqcn)

'sqcn.Open()

if Row.Col1_IsNull Then

sqlCmd.CommandText = "Insert into AuditLog values('ERROR','Missing','" + Row.Col5 + "','" + Row.Col6 + "') "

sqlCmd.ExecuteNonQuery()

end if

End Sub

[/Code]



Without using SqlConnection and SqlCommand is thereany way I can get the Connection Obj and able to insert rec in the table.



Thanks



View 1 Replies View Related

OLE DB Command Transform

May 8, 2007

Hi All ,





I am creating packages from a template package whicg I have built ,I have managed to implement basically everything sucessfully .Setting Properties on all the different tasks ,Connections etc except for the OLE DB Command transform.



I have not been sucessfull in getting to the properties or collections which allows me to do the mapping of the Command to parameters (Command Below),I am aware that the command executes for every row . I really need help with how to now do the mapping between the columns and the Paramaters programmatically in c#



I have set the sql command properties of the OLE DB Command Transform,as below



//Setting Update Comand ComponentProperties

IDTSComponentMetaData90 oledbCMDUpdate = dataflow.ComponentMetaDataCollection[0];

oledbCMDUpdate.Name = "name" ;

oledbCMDUpdate.RuntimeConnectionCollection[0].ConnectionManagerID = pack.Connections[0].ID;

CManagedComponentWrapper instanceCMD = oledbCMDUpdate.Instantiate();

instanceCMD.SetComponentProperty("SqlCommand", GetUpdateSQL(tablename)) ;



The Sql that is returned by the GetUpdateSQL(tablename)) method is below



UPDATE [ADM_AdjustmentAction]
SET AdjustmentActionCode = ?
,AdjustmentActionName = ?
,AdjustmentActionDescription = ?
,AdjustmentActionEFD = ?
,AdjustmentActionETD = ?
,UserID = ?
,ProcessDatetime = ?
,ModuleID = ?
WHERE AdjustmentActionID = ?



Thanks in Advance

Cedric


View 5 Replies View Related

TRANSFORM Query

Aug 31, 2006

I'm new to SQL Server 2005. I used the TRANSFORM query in Access to display the data I had stored in columns into rows. I want to do something similar in SQL Server 2005 but it doesnt let me. I have used the same query here, but it gives an error.

This is the query I was running in Access and it was working:

TRANSFORM Max(Schools.Expense) AS MaxOfExpense
SELECT Schools.[FiscalYear], Max(Schools.[FIPS]) AS [Total Of FIPS]
FROM Schools
GROUP BY Schools.[FiscalYear], Schools.[FIPS]
PIVOT Schools.[DataID];

If there some other syntax for SQL Server or it doesnt support this command or what???

View 1 Replies View Related

Need Help With LOOKUP Transform

Aug 22, 2007

I have a very simple problem I am trying to solve.

I have a table with a "DateEntered" field, and I have an ssis pkg set up to load data from a file into the database table. I just want to make sure that no one loads the same file twice in one day.

For example, if today is 8/22/07, and "DateEntered" is "2007-08-22", then I want to add a Lookup transform to run a query that will check and see if there's any rows in the table with a "DateEntered" is "2007-08-22". If so, don't load the file again!

Here's my query:

SELECT Code
FROM myTable
WHERE DATEADD(dd, DATEDIFF(dd, 0, DateEntered), 0) = DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)

(all the dateadd stuff is doing is removing the time portion from the DateEntered field, so we are comparing apples to apples).

Now, if the query returns a bunch of "Codes" then we know that the data has already been entered for the day! So far, so good.

Now, how do I set up the Lookup to get it to work? I'm getting this error message:
Error 1 Validation error. Data Flow Task: Lookup [1299]: The lookup transform must contain at least one input column joined to a reference column, and none were specified. You must specify at least one join column. FXRateLoader.dtsx 0 0

But I thought I did this! On the columns tab, I have:
Lookup column: code
Lookup operation: Replace 'code'
Output alias: code

I have my error output set to:
Lookup output - redirect row

I don't know what I'm doing, obviously..........!

Need assistance :-)

View 13 Replies View Related

Lookup Transform

Jan 24, 2007

Hi!
I am a newbie, grateful for some help. I have a Source Ole DB w sql-command selecting the customer.salary and customer.occupation, which I want to match with demo_id in Ole DB destination.
salary, occupation also in dim_demographic.
But in Lookup editor I find no column demo_id... how do I do this?

View 20 Replies View Related

Need Help On Lookup Transform

Jun 25, 2007

Please suggest me an article that describes 'Lookup Transform' (Specifically passing parameters) in detail.



Note: Is it possible to pass "variable" as parameters in Lookup transform?

View 10 Replies View Related

CLR SP To Transform Xml (SecurityException)

Feb 27, 2006

I am in the process of creating a simple managed stored procedure using C# and VS2005. The goal is to transforms an Xml document with a Xslt file that may contain a very simple script .

<msxsl:script language="C#" implements-prefix="user">
<![CDATA[
public static string Lower(string value)
{return value.ToLower();}
]]>
</msxsl:script>

At this stage my stored procedure code is extremly simple.

[Microsoft.SqlServer.Server.SqlProcedure]
public static void Manufacture(string xsltFile, string xmlFile)
{
XslCompiledTransform xslt = new XslCompiledTransform(false);
PermissionSet ps1 = new PermissionSet(PermissionState.Unrestricted);
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), ps1);
xslt.Load(xsltFile, XsltSettings.TrustedXslt, resolver);
....more code....
xslt.Transform(xmlFile, xslArg, ms);
}

If I execute the SP above and the script exists in the Xslt file, I get the following error upon loading the Xslt file. If I remove the script it transforms perfectly.

A .NET Framework error occurred during execution of user defined routine or aggregate 'Manufacture': System.Security.SecurityException: Request failed.
System.Security.SecurityException:
at System.Xml.Xsl.Xslt.Scripts.CompileClass(ScriptClass script)
at System.Xml.Xsl.Xslt.Scripts.CompileScripts()
at System.Xml.Xsl.Xslt.QilGenerator.Compile(Compiler compiler)
at System.Xml.Xsl.Xslt.QilGenerator.CompileStylesheet(Compiler compiler)
at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
at System.Xml.Xsl.XslCompiledTransform.CompileToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)

I have tried messing around with CAS and giving virtually everything full trust. Nothing resolves the issue.

Any ideas?

View 6 Replies View Related

LookUP Transform...

Apr 16, 2007

Dear friends,

I have a ETL that have a Lookup transform to get a rate from a table SpotRates.

The problem is when the match od some date in SpotRates Table doens't exist...

And for that records I need to lookup for next date...

For example...



SpotRate Table









Date
Currency
Rate

05-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2262

06-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2312

07-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2179

10-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2099

11-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2105

12-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2125

13-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2094

18-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2252

19-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2346

20-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2346

21-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2315

24-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2365

25-04-2006 0:00
DOLAR ESTADOS UNIDOS
1,2425



When I first try to lookup the date 17-04-2006, doesnt give me any records... and I need to create a new lookup for the next date from 17-04-2006. And in this example the next date is 18-04-2006.. How can I do it??

I made a sql query date gives me the next date with 2 parameters ... but I'm having some errors...



SELECT TOP 1 Data
FROM Spot_Rates
WHERE (Currencies_Name = ?) AND (Data > CONVERT(DATETIME, ?, 102))
ORDER BY Data DESC



In this exampple, the parameters returned from lookup1 is:

Currencies_name= 'DOLAR ESTADOS UNIDOS'

DATE='17-04-2006'



I need to create a second lookup transform to return the next date/currency for each row that didnt match in the first lookup...

Regards,



Pedro









View 16 Replies View Related

Lookup Transform

Aug 10, 2007

I want to do something relatively simple with SSIS but can't find an easy way to do this (isint it always the case with SSIS )

I have a column lets say called iorg_id, and I want to lookup the matching rows for this col in a table.
In this table iorg_id may have several potential matching rows. In this table there is another col called 'Amount'.
I want to retrieve for each iorg_id the matching iorg_id in the other table but only the row with the largest value in the 'Amount' col.

I couldn't find a way to do this all in the Lookup Transform.
I can match the iorg_ids and retrieve the Amount column, but can't find a way just to retrieve the matching row with the largest value in the Amount col. The only way I can think to do this is then run the output from the Transform through an Aggregate function and determine the Max (although haven't tested this yet).

Seems strange to me in that the SQL in the Advanced tab gives me something like:
select * from
(select * from [dbo].[Table1]) as refTable
where [refTable].[iorg_id] = ?

where I believe the first 'select *' is retrieving all the cols that are listed in the LookupColumns list in the Columns tab.
I thought I would be able to amend this to something like:
select max(amount) from
(select * from [dbo].[Table1]) as refTable
where [refTable].[iorg_id] = ?

but I get a metadata type error.

So, questions are:
Is it possible to do this all in the Lookup Transform are do I have to use the Aggregate function as I think ?
Why is it not possible to amend the sql in the Advanced tab to manipulate the returned data ?

View 3 Replies View Related

Pivot Transform Help

Sep 5, 2007

I need to transform the following layout by hopefully using the pivot transform, but am confused about the editor ......I have a compound primary key that I want to keep intact but then values in the row need to be broken out into their own row.

I need to go from this...

PKcol1 PKcol2 PKcol3 col4 col5 col6 col7
A 2007 1 Y N N N
A 2007 2 Y Y N N
A 2007 3 N N N Y

into this....

A 2007 1 col4 Y
A 2007 1 col5 N
A 2007 1 col6 N
A 2007 1 col7 N
A 2007 2 col4 Y
A 2007 2 col5 Y
A 2007 2 col6 N
A 2007 2 col7 N
A 2007 3 col4 N
A 2007 3 col5 N
A 2007 3 col6 N
A 2007 3 col7 Y


Can I do this using the pivot transform? Any suggestions?

View 4 Replies View Related

TRANSFORM && PIVOT Equivalents?

Jan 16, 2003

I am trying to find the equivalent to MS Access's TRANSFORM and PIVOT in T-SQL. I've tried using GROUP BY with CUBE, and I can't seem to get the data in the correct format. Can someone help? And please explain things to me like I am an idiot, because I am.

Here is the current table and the desired results that I want.

Current Table
MonthTypeSubtypeTotalTime
1TaskASubA5
1TaskASubB10
1TaskASubC8
1TaskBSubX5
2TaskASubA4
2TaskBSubX5

Desired Result:
TypeSubTypeJanuaryFebruary
TaskASubA54
TaskASubB100
TaskASubC80
TaskBSubX55

Thanks.
Colleen

View 5 Replies View Related

DTS - Datapump, Transform Data

Feb 24, 2001

Hi,

On my MS SQL Server 2000, I am trying to create a generic way to load tables into my datawarehouse.

I have as input to the process a large number of table definition(s) stored individually as files on my server. And, ascii delimited data files in various locations but mostly accessible via NFS mounts.

I created two DTS package in MSSQL2K that in theory represents what I want to do:

package1
... invoke package2 with global variables to load a system of related tables

package2
... check for a trigger file
... set the "Execute SQL Task" statement to my first file
... run the "Execute SQL Task" which drop/add's a table
... set a "Connection" to a data source file that I want to use
... run the transformation
and, with that my package starts to fall apart
... set the "Execute SQL Task" statement to the next file, and
...... goback and execute it

I can't figure out how to set the table in the transformation section to the table I want to use. And, I assume next to have the transformations links between the source and new table relinked.

The source files contain in the first row the column names as found in the tables I just created.

thanks,

Dave Rowsome

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved