.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Easiest way to Import Multiple Spreadsheets into the same table

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server


I am trying to found out the most simple way to import multiple spreadsheets (myspreadsheet*.xls) into the same table. I found this process relatively straight forward with importing multiple text files (myTextFile*.txt) into the same table.

Any help would be greatly appreciated.

Thanks in advance,


If you have found any of my posts helpful then please vote them as helpful. Kieran Wood MCTS BI, PGD SoftDev (Open), MBCS http://uk.linkedin.com/in/bileeds

View Complete Post

More Related Resource Links

Import XML File to SQL Table

Here is a brief example of importing an XML file into SQL Server table. This is accomplished by using the BULK option of OPENROWSET to load the file, and then utilizing the XQuery capabilities of SQL Server to parse the XML to normalized table format. This example requires SQL server 2005 or SQL Server 2008.

First, the following XML is saved to XML file C:\Products.xml.

merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

Import Multiple XML files into Sql Server

Hi, i have nearly 1000 xml files in one folder of similar format and I have xsd for the same as well. I would like to import all the files in to sql table by either looping through all the files or any other way. Thanks

Import Multiple Text Files

I have 150 data delimited text files that need to be imported to a text file. Each of them is named for the table for which they contain data e.g. address.txt contains data that needs to imported to the address table. So what I have done is create a SSIS package that contains a ForEach loop that iterates through the the files, and has a Load Data field object. What I haven't been able to figure out is what logic needs to be added for the Data Flow. I know I will need a Flat File Source with a connection source that is tied to file it is processing.  However, after all of that I am not sure what do because each text file contains a different table with different columns. Can someone explain to me how to handle this? Thanks, Isaiah 

How 2 join Multiple Keys based table???

I have a table INC with 2 Columns/Fields, i.e. YR and CL set as primary keys by selecting both the columns and selecting primary key symbol with right click. How to set up a FK with the other table INC_DTL's CL which I seek to be restricted to a combination of the INC's 2 fields? Thanx in advance.

import multiple Excel 2007 files using openrowset

hello, I Have a folder that includes multiple excle files (ver 2007), i am trying  to loop through each file using vbscript to import its data to sql 2000 using openrowset but i am getting this error in the openrowset line "[Microsoft][ODBC sql server driver] [sql server] [OLE/DB provider returned message: the microsoft office access DB engine cannot open or write to the file '', it is already open exclusively by another user or you need permission to view or write its data] code 80040E14 source microsoft OLEDB provider for ODBC drivers Any help please    

Infopath 2007 Repeating Table - Multiple Value Column Text - Hiding Rows based on Column text values

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

Import DataTable into SQL Table

I'm trying to parse a text file into a sql table.  I have the code to parse the file and display it in a datatable but for the life of me I can't figure out how to import it into a sql table.  All my previous experience has been with csv files and with schema.ini files.  This is new to me.  This is what the code to read the text file and display it in a datagridview: Dim dtTest As DataTable Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dtTest = New DataTable DataGridView1.DataSource = dtTest.DefaultView End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim filename As String = "C:\Price.txt" Dim lstValues As New List(Of String) Try Using sr As StreamReader = New StreamReader(filename) While Not sr.EndOfStream Dim splits As String() splits = sr.ReadLine.Split(","c) dtTest.Columns.Add(splits(1), GetType(String)) lstValues.Add(splits(2)) End While End Using Catch ex As Exception End Try dtTest.Rows.Add(lstValues.ToArray) End Sub This is what the data in the text file looks like: DD/MM/YYYY HH:MM:SS,LAU4AB,245.35 DD/MM/YYYY HH:MM:SS,ROC06,123.45 DD/MM/YYYY HH:MM:SS,GRE033,87.5 The second item "LAU4AB is the column header for the first

Multiple Source connections in Configuration Table

 I am trying to query multiple servers for properties and record those properties in a table for later use.  I can make this work with the ForEachEnumerator by querying a table. However, I would like to use the Package Configurations option if I can instead.  Any options? Is there a way to force the package to loop through multiple values for one variable, contained in an SSIS configuration table?  Thanks in advance!

searching SQL table with multiple parameters

I want to query an SQL table using some Web controls to provide the parameters for filtering the records in the table. Results are displayed in a GridView. I have a TextBox with an ID of "keyword" where the user may enter one or more keywords. I'd like to search 2 columns for instances of these keywords. I also have a DropDownList named "category" that lists categories contained in a "category" column of the table. I have a dataset with a TableAdapter for the table I want to search. Got it working fine with the DropDown List but not sure how to proceed with the TextBox and keywords. What SQL query should I use? The user may not enter anything into the textbox, they may enter one word, or multiple words. This is where I am now: SELECT * FROM tablename WHERE category = @category AND ?????  

group on or filter multiple datasets in 1 table?

I am fairly new to using BIDS, so please bear with me. I currently have 2 datasets, and 1 table.  The layout of the table is: Header HeaderGroup1 HeaderGroup2 Details FooterGroup2 FooterGroup2 Footer Group1 Footer Group1 Footer This is working, but what I need to do is figure out a way to add another Footer Group2 that includes an expression which involves either using data from a 3rd data set because of needing a different filter, or figuring out a way to filter the same data set twice in the one table.   I can give more specific info if you let me know what you need. Thanks!

Entities Data Models with multiple Categories using a membership table

(Using SQL Server 2008 and ASP.NET MVC2) I have a simple business table and a category table. I have a 3rd table to map business to category, a many-to-many relationship. the Map table contains a BusinessID and CategoryID. I'm lost as to how I can load the categories into my Business View Model using the entities model.Without incorporating categories, my code looks like this: var businessList = from b in entitiesDB.Businesses select new Models.BusinessViewModel { BusinessID = b.BusinessID, Name = b.Name } with Business View Model defined as: public class BusinessViewModel { [ScaffoldColumn(false)] public Guid BusinessID { get; set; } public string Name { get; set; } public List<Models.CategoryViewModel> Categories { get; set; } } but if i want to populate the Categories with the mapped categories, how would one do that?Thanks in advance for any help!

Adding a table or view multiple times when building a query with BI Report Designer and Report Build

How can I add a table/view multiple times to a single query by using BI Report Designer or Report Builder 3.0? In Report Designer I managed (workaround) to add one table multiple times by creating multiple Named Queries and having the same SELECT. Still I don't know how to add one table multiple times in Report Builder 3.0.

Most Recent records from one of the table among the tables in multiple joins.


Hi All

I have a single select query with multiple table joins in it.

I want to retrieve the Most Recent records from one of the table among the tables in multiple joins.


(select t1.col1, t2.col2 , t3.col3, t4.col4, t4.Add_Date,t5.col5,

from dbo.table1 t1

left outer join dbo.table2 t2 on t1.col1=t2.col2

left outer join

(select col3 from dbo.table3 where condition1="expr") as t3

on t1.col1=t3.col3

left outer join dbo.table4 t4 on t1.col1=t4.col4 order by t4.Add_Date

left outer join dbo.table5 t5 on t1.col1=t5.col5 )

Problem is that, I am not able to use the "Order by" for a particular table.



embedding multiple dropdowns in Table


I'm trying to embed multiple labels and dropdowns in a Table.

So I have 12 rows by 5 columns and i'm dragging dropdowns into columns 2 and 5 and text in columns 1 and 4.

It looks ok in design view but when I render to browser view it like explodes all over the page.

I can't seem to figure out how to set the column widths individually either.

Any advice?

thanks in advance

select top row for multiple entry for a date in table


My current query is

select  Date= createdon , Total=count(*) from ReportDetail where 
reportid = 9 and (CreatedOn BETWEEN '07/01/2010' AND '09/30/2010') 
group by  createdon
order by createdon desc

return data like

2010-09-21 09:36:46.493    112
2010-09-21 08:33:12.667    114
2010-09-21 07:45:20.830    176
2010-09-21 07:33:34.340    114
2010-09-20 07:27:43.753    125
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

What I am looking for

2010-09-21 09:36:46.493    112
2010-09-17 10:04:27.120    75
2010-09-16 11:50:05.777    52

Basically for 9/21, I want to get only one latest row. Please advice.

DetialsView where each row has multiple detail rows from another table


Hi everyone,

I have a <asp:DetailsView> based on a table that has a details table, like so:

DB1 --> TABLE1 --> Customers: ID, name, street, mail

DB1 --> TABLE2 --> SitesToCustomers:  CustomerID, SiteID

Problem One: I need my details view to show / edit both values from customer table and SitesToCustomers table, How do i do that?

Problem two: The site name (oppesed to its code that is saved at SitesToCustomers) is found on another DataBase in this table:

DB2 --> TABLE1 --> Sites: ID, SiteName

How can make the data source show site names according to their id's from SitesToCustomers table?

all of the code behind is c#.

Any help will be much appreciated,

and please use code examples, i'm pretty new to asp.net / c#.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend