Import from Excel to Sql Table - ado.net

I have excel sheet and I have 5 columns all are of type VARCHAR's.
I have a Table called Details and has 5 columns all of type VARCHAR's.
I have to import the data from Excel to table every day.
I am manually copying the records from excel and pasting them into the sql table. This approach is easy and quick.
But I want to make it automated.
Can I do it through the coding by giving the location of Excel Sheet.
I am using SQL 2005 and Excel 2007.
Any suggestions or directions please.
Thank you.

You can use Integration Services to import excel files automatically, here is a good example:
http://www.techrepublic.com/blog/datacenter/how-to-import-an-excel-file-into-sql-server-2005-using-integration-services/205
You can also use Import/Export Wizard within SQL Server 2005 as well, which does the same job and also allow you to save it as a SSIS package.

Related

Use query SQL in Crystal report

I have a complicated SQL in Excel to generate a raw data table for report from SQL server OLEDB . I would like to use Crystal Report to generate a neat and formatted report. I can use the Excel raw data table as the Crystal report database data source. But, Excel need to be refreshed every time new report is required. How can I use the Excel SQL command text string to be Crystal Report data source?
My Excel connect string: Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=MicrosoftDynamicsAX;Data Source=SQL2;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RD04;Use Encryption for Data=False;Tag with column collation when possible=False
I have Crystal report version 8.5 and 11.
Its simple
While creating the connection dont select tables instead use add command and then paste the query in the box and use in reports

Exporting table names and columns in Excel with Oracle SQL Developer

How can I export only table names and its columns to an excel sheet from a database using Oracle SQL Developer version 4.
I tried exporting database feature, but it does not allow excel export for Metadata.
Sorry if this is asked in wrong forum
Query what you want eg:
select owner,table_name,column_name
from dba_tab_cols
where owner = 'SCHEMA';
Then right click on the result and choose Eksport.... Choose a format and save.

Why in some WebI reports Exporting Excel not happening

I have 5 Webi reports and all these reports works fine. Out of the 5 reports , 3 reports i could export to available mode. But the other 2 reports too i can export to pdf or excel or excel 2007. Here come the problem. When i export to excel or excel 2007, i do not get the exact structure of the report, like the table and the values. What i get is complete blank with Report Tab name.
Have anyone gone through this kind of problem? If so please help me if i went wrong for this 2 reports alone.
Thanks
Niki.
First select the Table and Check in Vertical Table setting and if you see any Blank variable added into report, please delete.
So that report will extract without any error.
You can set preferences if you want to optimise export to Excel to preserve formatting or preserve data. Try configuring your preferences to preserve data or preserve formatting when exporting to excel and experiment.
Exporting to excel can be tedious, your webi report needs to be optimised to properly export to excel and preserve formatting and data

Replacing Crystal Report data source with store procedure

I used to create crystal reports by going into database expert, selecting tables and specifying the link manually. As I get a bit more comfortable with CR, there is a need for me to put the underlying SQL query into a store procedure to provide data to the report. But doing so will require me to rewrite the whole report which is time consuming.
So, my question is if there are any guru in the community that could and/or have tried to replace the underlying SQL (created by manually add table and links) with a store procedure or cmd without having to rewrite the whole report? I would love to get some hint of how to do that as I have a couple dozen of reports that need "adjustments" and time does not permit me to rewrite them all.
My Crystal Report versions are CR 2008 and CR 2012.
Thank you in advance.
In case you can use an existing software : this feature is available in a free Crystal reports viewer. Here is the documentation, which explains the use :
http://www.r-tag.com/Documents/RTag%20DataSource.pdf
... and here is where you can get your free license:
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx
Crystal does an absolutely horrible job of migrating from many tables to a single DB object, be it a Command or stored procedure.
You might be able to Database | Set datasource location... to map your SP to one of the many tables in the report (choose the one that has the most fields in use); I've never been able to get this feature to work trying to map a Command to a table.
'Best practice' for a really-poor 'feature' set:
create a formula field for each field that will be on the canvas, but isn't grouped (these fields won't be removed when you change datasources)
add the Command to the report; link tables if desired
manually switch grouping, record-selection formula, sorting, etc.

Excel Export Fail when Number of rows in the Excel sheet exceeded the limit of 65536 rows ssrs

In SSRS 2008 (I use Sql Server BIDS to create reports) how to solve "Excel Export Fail when Number of rows in the Excel sheet exceeded the limit of 65536 rows ssrs" issue
Thanks
Yes, this is a limitation of SSRS through 2008R2.
SSRS 2012, included with SQL server 2012 will remove this limit:
http://blogs.msdn.com/b/farukcelik/archive/2012/02/01/sql-server-reporting-services-ssrs-reporting-services-in-sql-server-2012-codename-quot-denali-quot-will-support-xlsx-docx-formats-bye-bye-65536-rows-limit-in-xls-files.aspx
The workaround for 2008R2 and before is to export as .csv
When your results are exceeding 65k rows (and you dont have SSRS2012), create a parent group on the tablix (or table, or list) and in the Group on: field enter the expression below.
Add Page break between each instance of a group
=CInt(Ceiling(RowNumber(nothing)/65000))
I think some Excel Versions can not support more then 65536 rows per se. You might consider to expand the data on several worksheets / tables.
A similar Issue is discussed here:
Is it possible to see more than 65536 rows in Excel 2007?
If your report is simple enough you can export as CSV, then import into Excel.
Export that data to csv file first.
then open a new Excel 2010 blank workbook.
Click file and open the exported csv file.
it will give you a Text Import Wizard prompt.
Continue clicking Next and then Finish.
If there is data that you need to keep as text ensure that in Step 3 of 3 you click Text for each column that you want to keep leading zeros if any.