Home > Archive > MS SQL Server ODBC > April 2005 > Connect to MSDE by CMD









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Connect to MSDE by CMD
Jan

2005-04-21, 8:23 pm

Hello,

is ther a way to connect to the command line for MSDE. I want to export data
from the MSDE database with a command line script!

How can I accomplish that???

Thanx,

M.J.


Ash

2005-04-21, 8:23 pm

Use BCP.EXE

http://www.microsoft.com/technet/pr...ppcsq.mspx#EGAA


"Jan" wrote:

> Hello,
>
> is ther a way to connect to the command line for MSDE. I want to export data
> from the MSDE database with a command line script!
>
> How can I accomplish that???
>
> Thanx,
>
> M.J.
>
>
>

Ash

2005-04-21, 8:23 pm

use bcp.exe
http://www.microsoft.com/technet/pr...ppcsq.mspx#EGAA

"Jan" wrote:

> Hello,
>
> is ther a way to connect to the command line for MSDE. I want to export data
> from the MSDE database with a command line script!
>
> How can I accomplish that???
>
> Thanx,
>
> M.J.
>
>
>

Hari Prasad

2005-04-21, 8:23 pm

Hi,

Execute the below command from command prompt

BCP mydb.dbo.tab1 OUT c:\table.txt -c -SServername -Usa -Ppassword

You can also load the data into table using "BCP IN" command.

BCP mydb.dbo.tab2 IN c:\table.txt -c -SServername -Usa -Ppassword

Replace a Database name, Table name, server name , password with actuals.

Thanks
Hari

"Jan" wrote:

> Hello,
>
> is ther a way to connect to the command line for MSDE. I want to export data
> from the MSDE database with a command line script!
>
> How can I accomplish that???
>
> Thanx,
>
> M.J.
>
>
>

Jan

2005-04-21, 8:23 pm

Hello,
When using :
bcp db01.dbo.messages out export.txt -c -t, -Usa -P ****

I receive an error :
SQLState = S0002, NaviveError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'db01'.

MJ
"Hari Prasad" < HariPrasad@discussio
ns.microsoft.com> schreef in bericht
news:53CF5ED7-9278-4EAB-A726- 36B02061B508@microso
ft.com...[color=darkred]
> Hi,
>
> Execute the below command from command prompt
>
> BCP mydb.dbo.tab1 OUT c:\table.txt -c -SServername -Usa -Ppassword
>
> You can also load the data into table using "BCP IN" command.
>
> BCP mydb.dbo.tab2 IN c:\table.txt -c -SServername -Usa -Ppassword
>
> Replace a Database name, Table name, server name , password with actuals.
>
> Thanks
> Hari
>
> "Jan" wrote:
>


Jan

2005-04-21, 8:23 pm

Thank you all it works!!

"Jan" <jan@msnews.com> schreef in bericht
news:ulK%23QqqRFHA.1564@TK2MSFTNGP09.phx.gbl...
> Hello,
> When using :
> bcp db01.dbo.messages out export.txt -c -t, -Usa -P ****
>
> I receive an error :
> SQLState = S0002, NaviveError = 208
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> 'db01'.
>
> MJ
> "Hari Prasad" < HariPrasad@discussio
ns.microsoft.com> schreef in bericht
> news:53CF5ED7-9278-4EAB-A726- 36B02061B508@microso
ft.com...
>
>



Ash

2005-04-21, 8:23 pm

I personally like to use a query to identify and know the sequence of fields
you are retrieving so try:

bcp "SELECT field1,field2..etc FROM Table" queryout export.txt -c -t,
-S<ServerName\INSTANCE> -Usa -P*****

Make sure you include server name and if you are connecting to a specific
instance
-Ash

> bcp db01.dbo.messages out export.txt -c -t, -Usa -P ****


"Jan" wrote:

> Hello,
> When using :
> bcp db01.dbo.messages out export.txt -c -t, -Usa -P ****
>
> I receive an error :
> SQLState = S0002, NaviveError = 208
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> 'db01'.
>
> MJ
> "Hari Prasad" < HariPrasad@discussio
ns.microsoft.com> schreef in bericht
> news:53CF5ED7-9278-4EAB-A726- 36B02061B508@microso
ft.com...
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com