Command Line

  • Is there a command line command to import .mdb file into SQL Server database

  • From the command line you could use SQLCMD. Variables can be used with SQLCMD too to make it more flexible.

    For example, to import Table1 from the db1.mdb database to a SQL database named myDatabase.

    C:\Test\SQLCMD -S myServer -E -d myDatabase -v TableName="Table1" -i myscript.sql

    -- Script file: C:\Test\myscript.sql

    SELECT * INTO $(TableName)

    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'C:\access\db1.mdb';'admin';'',$(TableName));

    GO

  • SQLCMD is for SQL 2005.

    How about BCP utility?

  • SQL ORACLE (4/9/2008)


    SQLCMD is for SQL 2005.

    How about BCP utility?

    You're right. Thanks for pointing that out.

    Edit: SQLCMD, while not included with SQL 2000, does work with SQL 2000 and can be freely downloaded from Microsoft: Feature Pack for Microsoft SQL Server 2005

  • bcp operates on flat text files, not mdb.

    ---------------------------------------
    elsasoft.org

Viewing 5 posts - 1 through 4 (of 4 total)

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