How to import data from Excel sheet into a table that has identity seed column? I have a stored proc to INSERT, how do I call it while creating an SSIS package where I mapped the excel columns to the database columns in SQL Server?
You shouldn't need a sproc to do this within SSIS. If you have mapped the Excel Source to the destination, the data flow will do the insert. You may need a data conversion task, since the strings in the Excel data will be unicode and SQL prefers DT_STR.
Related
I have an excel file that collects data from multiple txt files into connected individual tables (1 table per each file) as connection only tables. I have done this because some of them contain >1m tables. In excel, I have appended those tables using Power Query/Apend function. I need to create a new table that contains all the data, however the resulting data is >1m rows, and I can't load it back to excel.
Is there a way to load my connection (summary of all tables) to access?
When I try to do that using import function in access, it does not recognise the connection as a table so I am not sure how to do this.
Thank you,
Load it to the Excel data model which doesn't have a 1m row limit.
You cannot load from PQ to Access (nor would you want to).
i have an excel document with conditional formatting and data validation lists and lookups.
The users populate this data in Excel.
I then read it into HANA DB and find any new records required to be enriched.
I would like then to be able to refresh the data in Excel with the data i have in HANA however when I go to import via ODBC I then get a table created.
Ideally, it would paste values back into Excel rather than creating a table object as this removed the formatting included originally
Are there ways around this?
Thank you
Create a hidden sheet where you can place your ODBC source table and write a VBA code that will copy and paste new records from ODBC connection to your user-friendly list. You may filter this enriched records via VBA or PowerQuery join or with something like index and match functions.
Using Execute SQL Task in SSIS - created Excel file- contains multiple columns and different data types.The issue here is INT/Money columns are displaying as a text columns in Excel even though excel table is created with Int/Money datatype
I have tried to used double precision,CY datatypes but nothing worked out.
CREATE TABLE `Employer` (
`MEMBERSHIP NUMBER` VARCHAR(30),
`RETIREE #` VARCHAR(12),
`COPID` CHAR(6),
`PERSON LAST NAME` VARCHAR(150),
`FIRST NAME` VARCHAR(150),
`RETIREE PLAN` CHAR(15),
`PLAN NAME` CHAR(200),
`BILL GROUP` INT,
`BRANCH ID` CHAR(3),
`CONTRACT NUMBER` CHAR(5),
`PBP` CHAR(3),
`BRANCH NAME` VARCHAR(150),
`COVERAGE MONTH` DATE,
`DUE AMOUNT` INT
)
Expected output should be in input datatype format.
OLE DB data types and Excel
Even if you can create Tables in Excel using OLE DB commands, excel files are not databases, where columns have data types. The OLE DB provider read only tabular data and need to specify a data type for each column. For this reason, you must specify columns data types when handling Excel, even if excel has the ability of storing multiple data types within the same column.
One of the disadvantages of using OLE DB provider to read Excel is that if a column contains mixed data types, it only reads the dominant data types and convert all remaining data types to NULL.
Importing data from Excel having Mixed Data Types in a column (SSIS)
Mixed data types in Excel column
Excel Number Format property
On the other hand there are a Cell property in excel called Number Format which is used to change the way values are shown in Excel. You can use this property to show values as Currency.
Format numbers as currency
HOW TO DISPLAY NUMBERS IN EXCEL 2010 AS CURRENCY
Solution
You can use two approaches to solve the issue:
(1) Changes Column Number Format using Script Task
You can add a Script Task and change the entire column Number Format using Interop.Excel.dll assembly.
Format an Excel column (or cell) as Text in C#?
Format Entire Excel Column Using C#
(2) Create an Excel template file
You can create an Excel file and change the columns Number Format as needed and use this file as template. You can copy the file the the destination directory, then perform data import phase.
Quick Start: Format numbers in a worksheet
The requirement is we need to create a PL/SQL procedure/function to read and load data from an excel file (.xls) to the database tables.
The columns/fields of table wherein the the data needs to be loaded are:
LineID - Sequence ID
ColumnNum - column number from the excel file
RowNum - row number from the excel file
Value - value of the cell in the excel file
I would like to ask if this is possible? I searched and found that most of the answers is that loading from an external file is possible if the file is in csv format. As for the table format where the data needs to be loaded, the format of the source is the same with the format of the table wherein the data will be loaded.
Thank you in advance.
You can create Oracle Database Gateway for ODBC
https://docs.oracle.com/cd/E18283_01/gateways.112/e12061/configodbc.htm
then you can access your xls just like regular database table using databse link
I have a sharepoint list which i have linked to in MS Access.
The information in this table needs to be compared to information in our datawarehouse based on keys both sets of data have.
I want to be able to create a query which will upload the ishare data into our datawarehouse under my login run the comparison and then export the details to Excel somewhere. MS Access seems to be the way to go here.
I have managed to link the ishare list (with difficulties due to the attachment fields)and then create a local table based on this.
I have managed to create the temp table in my Volatile space.
How do i append the newly created table that i created from the list into my temporary space.
I am using Access 2010 and sharepoint 2007
Thank you for your time
If you can avoid using Access I'd recommend it since it is an extra step for what you are trying to do. You can easily manipulate or mesh data within the Teradata session and export results.
You can run the following types of queries using the standard Teradata SQL Assistant:
CREATE VOLATILE TABLE NewTable (
column1 DEC(18,0),
column2 DEC(18,0)
)
PRIMARY INDEX (column1)
ON COMMIT PRESERVE ROWS;
Change your assistant to Import Mode (File-> Import Data)
INSERT INTO NewTable (?,?)
Browse for your file, this example would be a comma delineated file with two numeric columns and column one being the index.
You can now query or join this table to any information in the uploaded database.
When you are finished you can drop with:
DROP TABLE NewTable
You can export results using File->Export Data as well.
If this is something you plan on running frequently there are many ways to easily do these type of imports and exports. The Python module Pandas has simple functionality for reading a query directly into DataFrame objects and dropping those objects into Excel through the pandas.io.sql.read_frame() and .to_excel functions.