MS SQL Server generates duplicate tables when importing an Excel file - sql

Anyone knows why a duplicate table will be generated when using SQL Server Import and Export Wizard to import an Excel file? For example, a table named LN$LN appears after the original table named LN$
Thanks!

I think there may be a hidden sheets in your excel
can you make a try like below.

Was just having an issue similar to this and then noticed the following in the excel spreadsheet I had been given. There was an entire duplicate of the data set hiding in the collapsed rows here only visible by the number color change and extra line. Oddly, unhide and cell height did not seem to work on this, but I was able to expand them back out and delete them by selecting above and below and double-clicking over it (just like you can for the column width to expand to fit).
If anyone is experiencing duplicate or unexpected data appearing during import check for something like this as well. Note that it can also appear in the middle (it does not have to be at the end) as I found several of these in the file I was given.

Related

Dynamic Column Headers working in Power Query but NOT on the Daschboard

I've been working with .xlsx files whose column headers change. As a result in Power Query I used Table.ColumnNames{1} to create dynamic headers that prevent me from getting an error when updating queries.
Despite no longer getting errors, dashboard is simply not working. whenever column names change, the matrixes and charts on the dashboard no longer recognize which columns were there.
How can I solve this?
Try solution from Curbal canal
https://www.youtube.com/watch?v=zUaVpgAdVGs

Microsoft Access Table Shows Up Blank, But Query Correctly Pulls Data From Table

I am having an issue with my Microsoft Access database. One of my tables looks completely blank, but it has 11632 records listed in the bottom. Take a look at this screenshot. Though the table shows up blank, when I run the query it pulls the correct data from this table, so I know the data is there, it is just not appearing for some reason. I have tried on Access 2013 and 2016 on a different computer, and both have the same effect. I have also tried compacting and repairing, and also exporting the table but the file it exports to also appears blank, aside from the field names. Any ideas on what I could try?
Thanks!
Turn your import into a 2 step process (or more...). Write it raw into a scratch pad table. Then fire an append query, that has the appropriate criteria to result in only valid records going into the final table.
This isn't unusual at all given that some outside data sources may not have the controls to prevent bad records. Sometimes one must "wash" the data with several different query criteria/steps in order to filter out the bad guys.

SSIS imports wrong numbers of data from excel

I am currently creating an SSIS package which imports data from excel to sql server. My problem now is I have 4998 rows on my excel source and everytime I try to run my SSIS package, it imports 5,010 data. I don't know where did it get the excess data. how can I fix this? can anyone help me please. Thanks!
Excel does this sometimes. It keeps track of the "data range", which sometimes extends beyond the actual data that exists. This "data range" is what SSIS will import.
If you look at your import table, you should be seeing 12 blank rows. Unless you've imported the header row, if any, as a row. That's another possibility: does your Excel sheet have multiple header rows (many do)?
It is possible to apply some kind of SQL to Excel datasources, but I avoid it because I don't trust Excel's handling of data. The solution is probably to identify a key column, which should always have a non-NULL, non-blank value of a certain type (e.g. a number or a date) in every "real" data row. Then delete rows that break this rule from your import table.
Excel importing is no fun!

Validate in excel before uploading to access

I am attempting to upload an Excel document into Access. I have used VBA to unhide all columns and rows and then delete columns and rows that are not being used. All of the worksheets upload into Access properly except one. This particular worksheet attempts to upload a field and label it Field 12. I am unable to find a way to delete this field. Any help?
It is probably the first column after your data...
Try either in VBA or in Excel deleting the columns to the right of your data (not just contents but an actual delete). I've found this typically happens when the columns to the right of your data contained data at one point and Access / Excel sees those as still containing data. Then try your import again.
Alternatively, you could upload into a new Access staging table before pulling your desired known columns into the final table through an INSERT query. Then you can delete the staging table if you like or delete it before the next import. In this way, each import can have its own "added columns".

What causes Excel export from SQL Server Reporting Services to produce an abnormally large file?

We have are relatively simple Reporting Services report that our users commonly export to Excel. I've noticed that the files produced by the Excel export seem unusually large. If I open one of these files and just click save, without making any changes, the file size reduces to about half of it's previous size. Has anyone else run into this and is there a known workaround?
You've mentioned that the report is relatively simple, but this is important to check. The export to Excel will go to extraordinary lengths to try and maintain how your report looks.
If you have lots of different borders or colours (particularly if different formatting is determined by the data in your report) this will bloat the file.
Also check if many columns with very small and unusual sizes are created in the exported worksheet. The export does this to try and match alignment in Excel with the original report.
Try recreating your report as a basic table with no formatting or headers/footers and see if you can reproduce the problem. If Excel's behaviour is acceptable then add each piece of formatting back until it goes awry. Please let us know what you find.
I don't have an immediate solution, but a common problem in Excel is files bloating because one/some/all of the worksheets have saved all 64K rows instead of the ones being used. The fix in Excel is to select all the lower rows not being used, and delete them, then save the spreadsheet, close and reopen. Therefore, I'd pursue the angle of extra rows being saved in the export, and see if there is a way to keep this from happening.
What tool are you using when exporting to Excel?
I have also managed to reduce # of rows in my Excel worksheet by copying it to another worksheet, then deleting the original sheet.
You could also try copying only the data in your worksheet, and paste it into a new Excel Workbook (file).
I had the issue where the exported Excel files took and extremely long to open and they would stop responding every time you clicked on a cell.
Also, extra and merged columns would appear in exported excel files.
The fix was to make sure my header text boxes lined up with the beginning and end of columns in the data table just below it. Once both were aligned, there were no more extra columns in the exported excel spreadsheets and the performance was back to normal.
Here's the reference that helped me understand the issue:
http://www.codegur.press/12747988/issue-report-export-to-excel-in-rdlc-report
May be I am answering your question very late. Here's the solution for exporting to CSV.
You need to give the a name that you want to see as a column header for the field (not the column name) in the designer.
By default all the text headers are exported as a separate columns along with the table columns and make sure that you name the Design name in the properties with the name you want to see.
The other important thing to note about the option DataElementOutput which is set to Auto meaning it will be exported. You can change that if you don't want it to be exported.
The last but not least thing ... after you export the data looks messed up. You need select the whole first column and go to the Data tab - > convert text to column -> use the delimiter as comma and say Finish. That should solve your issue.