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
没有评论:
发表评论