jfkennedy5


Hello All,

I imported a excel file from SSIS and created a table called Lockbox.
To avoid the user from having to change the excel file -it is being imported as is.
I only need 4 fields: [Contract ID] , [Check Number], [Owner ID], [Site ID]

The table I need to import to Transaction has Diffrent Column Names -ex-CustomerID, ResortID.
The columns are in diffrent order.
And I need to add more information into them like UserID = 'Hwells', Trantype = 'MF'
and convert to a diffrent data type [Site ID] to text.

Is their a sql statment that can do this

SQL2005

Thanks for your time



Re: SQL Statement

Rob Farley


I'm trying to work out what you mean here...

Following your imports, you have tables dbo.[Lockbox] and dbo.[Transaction], and now you want to add extra columns and change the types If so, you want to use "ALTER TABLE". Read more on this at: http://msdn2.microsoft.com/en-us/library/ms190273.aspx.

Good luck!

Rob






Re: SQL Statement

Louis Davidson

Not automatically. You could either:

1. Build a SELECT statement to format the data like you want using the INTO keyword to create a new table.

2. (the better answer) Spend a bit of time building the SSIS package to format the data like you want and transform the data into the proper columns of a table that you create before running the import. This is the far easier to manage and once you get it set up properly it will be a very repeatable process..