2012年3月29日星期四
bcp.exe installation
more appropriate place)
I'm using the bcp utility to create a text file from a view. The text file
is used by a 3rd party program for other processing.
bcp installs on the server machine with sql 2k (or in my case MSDE) just
fine but of course it's not automatically on any of the client machines. But
that's where I need it because those are the users that create and make use
of this text file.
My qustion is how to install bcp on the client machines without installing
MSDE. I thought it would work to just copy the file to an appropriate
location but apparently it needs to be installed. How do I go about that?
Thanks,
Keith
Never mind. I found a very nice inexpensive 3rd party control for use with
Delphi that will export datasources to all sorts of output formats. This is
a better solution since now I have no need at all for bcp.
Keith
2012年3月25日星期日
BCP Syntax
bcp database.dbo.table out "c:\table.dat" -U? -P? -c
bcp database.dbo.table out "c:\table.dat" -T -c
Do I have to be in App_data directory where my database reside.
There are 2 authentication modes that bcp supports:
a) SQL Server authentication in which case you have to specify your SQL Server login and password, say your SQL Server login ID is foo and password is bar then you should specify -Ufoo -Pbar.
b) If you can login to SQL Server using Windows authentication, then just specify -T and it will used Trusted connection.
Thanks
2012年2月13日星期一
Batch file to restart SQL
Hey all.. I am wanting my SQL Server installation to restart its services at a time I define in the Scheduled Tasks feature of the server its on
I need help with command line commands to:
- Stop SQL Server Agent service
- Stop and Start SQL Server service
- Restart SQL Server Agent service
Thanks in advance
from the command prompt:>net stop MSSQLSERVER
>net start MSSQLSERVER
>net stop / start SQLSERVERAGENT