Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert data from Excel in to a sql server database table

Status
Not open for further replies.

Malc8179

MIS
Oct 8, 2007
28
GB
Hi Guys

Can you help I’m building have a excel compiler that creates a set of data to be added to a table in a database on a SQL server, the users can run this at any time the issue I have is how do I insert in to the table from excel using code
 
Use ADO:

Create a connection to the database

Execute an UPDATE or INSERT command as you would whenever you run SQL

et voila

Search this forum - there's loads of examples of using ADO. All you really have to change is the specifics for your connection and the SQL you want to run...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Just a thought.
SQL server Enterprise manager can Import all kinds of things including Excel. and you can create a stored procedure and run it. SQL server 2005 its not called Enterprise manager anymore. Also go to SQL forum here and ask for help
I don't have SQL in front of me but there are a lot of ways to automate it too.

DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top