Solved

How to store an excel file in sql server????????????

Posted on 2008-10-16
9
1,013 Views
Last Modified: 2013-12-17
Hi experts,

      I want to store some whole excel file into sql server database, but dont know how to do it. I want to do it using asp.net and C#.

      Can anybody help me for this.

Regards,
Paramhans
0
Comment
Question by:Paramhans
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:Kumawat_Shobha
ID: 22728718
pass this filepath(filepath\filename.xls) to a stored procedure as a argument
and user openrowset query in your stored procedure to store this excel file in to sql server database
0
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 400 total points
ID: 22728787
0
 
LVL 2

Expert Comment

by:tree33
ID: 22728788
Do you want to import to content of the Excel to a table, or save the file in the database?
If you want to save to file then u could use a varbinary datatype to store binary data.
0
 

Author Comment

by:Paramhans
ID: 22728913
I want to store the whole file into database. Can anybody provide me the code for that.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Paramhans
ID: 22728918
means i want complete file and not its content to be stored into database
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22728950
did u check my link.. its contain the sample
0
 

Author Comment

by:Paramhans
ID: 22729006
I checked it now but the code is given for storing the image into database. Will it work for an excel file too?
0
 
LVL 2

Assisted Solution

by:tree33
tree33 earned 100 total points
ID: 22738157
Yes, that example will work for all kind of files.
Just change the datatype of the column to varbinary(max).
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22738598
yes, it will work
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now