Is it possible to update SQL table from Excel?

Is it possible to update SQL table information directly from excel? I would like to be able to update, insert and delete values and rows in my spreadsheet and for the changes to take effect in the back-end table interactively in the same way as imported data is updated upon refreshing my spreadsheet.
draesideAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brad Sims, CCNANetwork AdministratorCommented:
The simple answer, yes.  But as far as 'interactively' I would get the information right and have a macro run after you're sure everything is ok.  You also need to have these permissions on the SQL Server.

What is your experience level with VBA?
0
draesideAuthor Commented:
I am a VBA beginner but have experience in other programming languages and pick things up fairly quickly. I have looked into SSIS and have managed to get this working however it would be better if I could achieve it via VBA/SQL.
0
bromy2004Commented:
I've found that updating SQL tables is easier from SQL Server management studio.

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

It has
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=D:\testing.xls;',
    'SELECT * FROM [SheetName$]') select * from SQLServerTable

Changes to Make:
Excel 8.0 - Excel x.x (your excel version number)
D:\testing.xls - address of your database
SheetName$ - if your sheet is "Sheet1" replace with Sheet1$
  or as the link says "To select a range of cells use a named range as SELECT * FROM NamedRange or specify the cell range as SELECT * FROM [Sheet1$A1:B10]
SQLServerTable - Your table name.

Using this allows for syntax errors and any other errors to be caught without extensive VBA coding/testing/error handling
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.