Insert into SQL table from Excel?

  • I want certain users to be able to insert rows into a particular SQL table, but I don't want them to have to ask me to do it via T-SQL or DTS.

    I can link to a SQL table in MS Access (via ODBC) and allow users to insert rows into a SQL table from there.

    Is there a way to do this same thing from MS Excel? If so, how? Most of our users are more comfortable with Excel over Access.

    Thank you.

  • hughesj23 (4/19/2012)


    I want certain users to be able to insert rows into a particular SQL table, but I don't want them to have to ask me to do it via T-SQL or DTS.

    I can link to a SQL table in MS Access (via ODBC) and allow users to insert rows into a SQL table from there.

    Is there a way to do this same thing from MS Excel? If so, how? Most of our users are more comfortable with Excel over Access.

    Thank you.

    You can use ODBC in Excel also. You just need to put your code in a macro and your macro does all the work. I would strongly recommend using stored procs for this type of thing as you do not want users directly running insert statements via pass through queries.

    You will need something in Excel to call your macro (button or something along those lines).

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply