April 9, 2008 at 1:40 pm
Is there a command line command to import .mdb file into SQL Server database
April 9, 2008 at 3:37 pm
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
April 9, 2008 at 3:47 pm
SQLCMD is for SQL 2005.
How about BCP utility?
April 9, 2008 at 3:57 pm
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
April 9, 2008 at 6:17 pm
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