Thursday 22 March 2012

Connect to MSDE by CMD

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.Use BCP.EXE
http://www.microsoft.com/technet/prodtechnol/sql/2000/books/c07ppcsq.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.
>
>|||use bcp.exe
http://www.microsoft.com/technet/prodtechnol/sql/2000/books/c07ppcsq.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.
>
>|||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.
>
>|||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@.discussions.microsoft.com> schreef in bericht
news:53CF5ED7-9278-4EAB-A726-36B02061B508@.microsoft.com...
> 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.
>>|||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@.discussions.microsoft.com> schreef in bericht
> news:53CF5ED7-9278-4EAB-A726-36B02061B508@.microsoft.com...
>> 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.
>>
>|||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@.discussions.microsoft.com> schreef in bericht
> news:53CF5ED7-9278-4EAB-A726-36B02061B508@.microsoft.com...
> > 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.
> >>
> >>
> >>
>
>sqlsql

No comments:

Post a Comment