Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to import data from excel to database

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2010-04-12 : 06:58:36
I Have data in excel, with 2 columns MatchID and Time, Int and Numeric datatype.

The data must be inserted into database.

How to do it.

Thanks
Ganesh

Solutions are easy. Understanding the problem, now, that's the hard part

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2010-04-12 : 07:12:07
Several ways are there:

1. You can design an SSIS package
2. Use Bulk Copy (BCP) command line utility
3. Use SQLBulkCopy class in .net, if you want to do it programmatically from code.

Designing SSIS package is by far the simplest and flexible approach.

Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-12 : 08:05:18
http://support.microsoft.com/kb/321686

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2010-04-12 : 08:44:30
I want to do it in SP, how to do it

Solutions are easy. Understanding the problem, now, that's the hard part
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-12 : 08:49:15
use OPENROWSET then as given in link

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-04-12 : 09:00:45
quote:
Originally posted by ganeshkumar08

I want to do it in SP, how to do it

Solutions are easy. Understanding the problem, now, that's the hard part


Refer this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -