How to write a query for importing access file

  • Hi Guys

    I am about to leave my present job as a SQL Developer. Now to make thing easier for the new person who takes up my role, I am designing store procedures for different queries I use to design database and create reports.

    Now first step is to import an access table into SQl server 2005. I knoe it can be done through Import/export wizard .

    But I want to create a stored proc which imports access file into my SQL database..

    Can you please help me guys as you have always done in past???

    Thanks:)

  • Are you looking for a generic procedure that can be used to import data from various sources? A more appropriate solution would be to just provide your coleague with an illustration of how external data can be accessed from SQL Server, rather than trying to develop a one-for-all procedure for the task, and he/she will be able to learn how to manipulate external data sources for himself/herself.

    Anyway, look at the OPENDATASOURCE and/or OPENROWSET system functions in Books Online. Note, that these two cannot be parameterized, so in order to allow configurable access to external files, one would have to resort to dynamic SQL.

    There are plenty of examples in Books Online.

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

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

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