Use a script to import a data item from excel into PowerDesigner - powerdesigner

As anyone used a VB script that imports a data item from an excel sheet into Power Designer using the EXECUTE COMMANDS functions.
Trying to write the script, but dont know where to start.
Thank you

Related

How to configure input columns when using dynamic Excel connection managers in SSIS

After creating a dynamic Excel connection manager with Visual Studio 2015 SSIS and iterating through multiple Excel files in a directory I have run into the problem of not being able to change the number of columns in the connection manager. The Excel files do not have the same number of columns (or heading names/locations). I'm passing the data from the connection manager straight into a script component in order to handle this.
I tried creating an Excel connection manager with more columns they I will ever use before switching it to a Package Connection and setting the Expressions ExcelFilePath to my For/Each loop variable but this doesn't seem to work. I've received the VS_NEEDSNEWMETADATA error after this and, after rebuilding, received a
"Column "F18" cannot be found at the datasource"
error when an Excel sheet with fewer than 18 columns was passed through the for/each loop.
Any suggestions or assistance would be appreciated. Thank you.
If the columns count are different between Excel files, you cannot use the same Excel source to import them. You will always get theƗVS_NEEDSNEWMETADATA exception that you mentioned.
If you are handling Excel files with same structure but with different columns order you can refer to my detailed answer on the link below:
Importing excel files having variable headers
If you have the choice to convert Excel files to Flat files, there are many links that describe the full process on how to import files with different structure.
If you don't have this choice, you must think on automating packages creation which is more complex (using BIML or DTS wrappers)
Update 1
Some links about converting Excel to csv:
Script task for converting Excel to CSV
Convert XLS to CSV on command line
Auto convert Xls to CSV
Convert xlsx file to csv using batch
Batch convert xls-Files to csv
SSIS process for saving .xlsx file as .csv file
SSIS using Script task - Convert XLS to CSV

Cannot export to a named Excel range using SSIS

I am developing a SSIS package which is retrieving data from database and exporting it into a pre-formatted Excel file. This is not the first time I am doing this, but this time it won't work and I can't find out why..
As you can see in attached image, SSIS exports data successfully but writes it in the bad cells, I specified the value "operateur$B14:F19" in the OpenRowset property of Excel destination in SSIS though..
In addition, I am getting an error which is saying:
Cannot Expand Named Range
How can I fix this?
SSIS is not right tool set to solve this type of scenario. Use SSRS.
But any way you can try below steps.
Populate required data in table and use micro or data connection to populate excel...

How can I import multiple csv files from a folder into sql, into their own separate table

I would like some advice on the best way to go about doing this. I have multiple files all with different layouts and I would like to create a procedure to import them into new tables in sql.
I have written a procedure which uses xp_cmdshell to get the list of file names in a folder and the use a cursor to loop through those file names and use a bulk insert to get them into sql but I dont know the best way to create a new table with a new layout each time.
I thought if I could import just the column row into a temp table then I could use that to create a new table to do my bulk insert into. but I couldn't get that to work.
So whats the best way to do this using SQL? I am not that familiar with .net either. I have thought about doing this in SSIS, I know its easy enough to load multiple files which have the same layout in SSIS but can it be doe with variable layouts?
thanks
You could use BimlScript to make the whole process automated where you just point it at the path of interest and it writes all the SSIS and T-SQL DDL for you, but for the effort involved in writing the C# you'd need, you may as well just put the data dump into SQL Server in the C#, too.
You can use SSIS to solve this issue, though, and there are a few levels of effort to pick from.
The easiest is to use the SQL Server Import and Export Wizard to create SSIS packages from your Excel spreadsheets that will dump the sheet into its own table. You'd have to run this wizard every time you had a new spreadsheet you wanted to import, but you could save the package(s) so that you could re-import that spreadsheet again.
The next level would be to edit a saved SSIS package (or write one from scratch) to parameterize the file path and the destination table names, and you could then re-use that package for any spreadsheets that followed the same format.
Further along would be to write a package that determined with of the packages from the previouw level to call. If you can query the header rows effectively, you could probably write an SSIS package that accepted a path as an input parameter, found all the Excel sheets in that path, queried the header rows to determine the spreadsheet format, and then pass that information to the parameterized package for that format type.
SSIS development is, of course, its own topic - Integration Services Features and Tasks on MSDN is a good place to start. SSIS has its quirks, and I highly recommend learning BimlScript if you want to do a lot of SSIS development. If you'd like to talk over what the ideas above would require in more detail, please feel free to message me.

Export data from sql server to excel using SSIS

First I will explain what is my requirement and then I will explain what I have done so far and what are all the helps I need...
I have to export data from sql server to excel sheet. The excel sheet will be like a standard template. If I run my project, the data from SQL Server should be inserted into a new excel file which should use that template and it should be created and saved into a new location. Also, generally we will use first row as header. But in my requirement, the template will have two or three rows header. So, the data should be inserted automatically from the third/fourth empty row.
I have done exporting data from sql server database to normal excel sheet with first row as header. I have also done exporting data from different tables into different sheets of the same excel file.
Any body please help out for the template format, creation of new excel file while running project and two or three rows as header.
I am using SQL Server 2005 and Visual Studio 2005.
Please help out...Thanks in advance...
If your export is to Excel 2007 or 2010 can you use EPPLUS to handle the Excel-files.
You can solve this using SSRS.
Create your report how it has to look like.
Then deploy it on a reporting server web.
Then create a subscription where you export the report to a excel file. You can setup location and time it has to run.
THe report can look like however you need it.

Import excel as mysql table using cakephp 2.1

Calling all cakephp gurus!!
I have hunted high and low, tied all excel readers, writers, helpers but to no avail.
I really need to import an excel file into a table, whether it creates a table or inserts into an existing one as per the excel columns iterations using cakephp 2.1
Your help would be so appreciated.
use CSV files instead of excel files(because if you try to use excel for this purpose your problem becomes more complicated as the excel file has a very complex structure than a simple csv file)
you can export excel files to csv easily using ms excel,or any other spreadsheet application
see these links
http://mrphp.com.au/code/importing-data-csv-cakephp
http://narendravaghela.com/cakephp/read-csv-file-in-cakephp/

Resources