Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Monday, March 19, 2012

Choosing explicit cell in Excel to SQL Database

Hi, is there a way to choose a specific Excel cell and put the value into a specifc column in a SQL table using the wizard? For example, when the package is run, to have cell B3's value placed into a newly created row in column 0 and have F6's value placed into the same row in column 1?

Thanks for your time,

James

EDIT: What happens currently is I'll map a particular Excel column and it will create almost 200 rows in my table with mostly null values, as that is the format of the Excel sheet. I would like to create 1 row per Excel sheet, with selected information input. Thanks!

It is unclear.

With the explanation you gave, I would recommend to look into ways to reformat your Excel input so you can use either PIVOT or UNPIVOT to load this into your database.

You will still have to deal with the potential lack of heterogeneity of Excel.

What if the user give you smashed potatoes?

Regards,

Philippe

|||

Hi, thanks for the response. The Excel sheet is template based - every Excel sheet put into the database has the exact same format.

What I'm looking to do is this:

I would like to take the value from one particular cell from the Excel sheet (say, B5 for example) and insert it into a particular spot into a new row of a SQL database table. So, in all, I want to create a new row in the table, put B5 into the first column of this row, E9 into the second column of this row, and F13 into the third column of this row. Does this make sense?

Thanks,

James

|||

It makes sense. A way would be to use Automation to trigger a macro in the workbook from the ssis package, this macro would put B5, F9 and F13 in one row on another spreadsheet and the package would load this spreadsheet rather than the original.

You could also create another spreadsheet with indirect references to the master sheet. That would work only if the cells to "normalize" have a constant position.

The question I am asking myself is "How do you know that B5, F9 and F13 have to be in Col1 Col2 Col3 Is it set in stone? "

May be you could Name these ranges, then load several times by refering these names, the first pass would create the row and insert Name1, the second and third pass would only update the row with Name2 and Name3.

I guess I prefer the last approach.

Philippe

|||

James, you can use DataDefractor SSIS source data flow component to extract data from Excel workbooks. It is template driven and it supports data extraction from specific cells, series of cells, columns, rows and any combination of the above. You can download a free beta of the component at http://www.datadefractor.com.

Choosing explicit cell in Excel to SQL Database

Hi, is there a way to choose a specific Excel cell and put the value into a specifc column in a SQL table using the wizard? For example, when the package is run, to have cell B3's value placed into a newly created row in column 0 and have F6's value placed into the same row in column 1?

Thanks for your time,

James

EDIT: What happens currently is I'll map a particular Excel column and it will create almost 200 rows in my table with mostly null values, as that is the format of the Excel sheet. I would like to create 1 row per Excel sheet, with selected information input. Thanks!

It is unclear.

With the explanation you gave, I would recommend to look into ways to reformat your Excel input so you can use either PIVOT or UNPIVOT to load this into your database.

You will still have to deal with the potential lack of heterogeneity of Excel.

What if the user give you smashed potatoes?

Regards,

Philippe

|||

Hi, thanks for the response. The Excel sheet is template based - every Excel sheet put into the database has the exact same format.

What I'm looking to do is this:

I would like to take the value from one particular cell from the Excel sheet (say, B5 for example) and insert it into a particular spot into a new row of a SQL database table. So, in all, I want to create a new row in the table, put B5 into the first column of this row, E9 into the second column of this row, and F13 into the third column of this row. Does this make sense?

Thanks,

James

|||

It makes sense. A way would be to use Automation to trigger a macro in the workbook from the ssis package, this macro would put B5, F9 and F13 in one row on another spreadsheet and the package would load this spreadsheet rather than the original.

You could also create another spreadsheet with indirect references to the master sheet. That would work only if the cells to "normalize" have a constant position.

The question I am asking myself is "How do you know that B5, F9 and F13 have to be in Col1 Col2 Col3 Is it set in stone? "

May be you could Name these ranges, then load several times by refering these names, the first pass would create the row and insert Name1, the second and third pass would only update the row with Name2 and Name3.

I guess I prefer the last approach.

Philippe

|||

James, you can use DataDefractor SSIS source data flow component to extract data from Excel workbooks. It is template driven and it supports data extraction from specific cells, series of cells, columns, rows and any combination of the above. You can download a free beta of the component at http://www.datadefractor.com.

Sunday, March 11, 2012

Chinese Language Characters

When I import an excel file to SQL that contains Chineses characters they get
distorted and illegible. How do I get SQL to interpret the characters
properly?
Thank you!
Several things need to happen.
You need to have the language pack installed on the PC. It sounds like you
do because you can see them in Excel.
The second thing you need to do is to use the nchar, nvarchar and ntext data
types when you create your tables. These are the national character sets
and allow for other language use.
If that doesn't work, ensure that you are using the appropriate collation
when you create your objects. You can set a collation for an entire
database, a table, or individual columns.
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"JuJu" <JuJu@.discussions.microsoft.com> wrote in message
news:E29BAD1F-8790-4D55-9AFA-301034186BB8@.microsoft.com...
> When I import an excel file to SQL that contains Chineses characters they
get
> distorted and illegible. How do I get SQL to interpret the characters
> properly?
> Thank you!

Chinese Language Characters

When I import an excel file to SQL that contains Chineses characters they get
distorted and illegible. How do I get SQL to interpret the characters
properly?
Thank you!Several things need to happen.
You need to have the language pack installed on the PC. It sounds like you
do because you can see them in Excel.
The second thing you need to do is to use the nchar, nvarchar and ntext data
types when you create your tables. These are the national character sets
and allow for other language use.
If that doesn't work, ensure that you are using the appropriate collation
when you create your objects. You can set a collation for an entire
database, a table, or individual columns.
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"JuJu" <JuJu@.discussions.microsoft.com> wrote in message
news:E29BAD1F-8790-4D55-9AFA-301034186BB8@.microsoft.com...
> When I import an excel file to SQL that contains Chineses characters they
get
> distorted and illegible. How do I get SQL to interpret the characters
> properly?
> Thank you!

Thursday, March 8, 2012

Cheking if report's rendering in excel

Hi,
Is there a way to use an expression to check if the report is in html or
Excel?
For instance, for displaying in html I could want some format, but in Excel
not.
Is there a way to test something like this':
=iif(ReportExcel, "GainsBoro", "White")
The part of ReportExcel, to test if Iâ'm in excel is the one I want to know
(ReportExcel should be an expression, that returns true of false).
Would be also nice to see if Iâ'm in html.
Basically, I want to avoid Actions in the excel file.
Thanks in advance,
Santiago E. ReilWhat you could do is have an extra parameter passed to the report lets say we pass temp.
Depending on if you are rendering in excel or HTML format pass 0 or 1 for the parameter.
Now you can use the value of temp to see if you are rendering in excel or HTML.
>--Original Message--
>Hi,
>Is there a way to use an expression to check if the report is in html or >Excel?
>For instance, for displaying in html I could want some format, but in Excel >not.
>Is there a way to test something like this':
>=3Diif(ReportExcel, "GainsBoro", "White")
>The part of ReportExcel, to test if I=E2?Tm in excel is the one I want to know >(ReportExcel should be an expression, that returns true of false).
>Would be also nice to see if I=E2?Tm in html.
>Basically, I want to avoid Actions in the excel file.
>Thanks in advance,
>Santiago E. Reil
>.
>