Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 bcp with Windows Authentication

Author  Topic 

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-08-14 : 08:34:43
Hi,
I'm logged into my (local) Database Engine locally using a Windows Authentication.

I tried executing the following command
exec master.dbo.xp_cmdshell 'bcp Northwind..table out maudit_%date:~4,2%_%date:~7,2%_%date:~10,4%.txt /c /Udomaine\login /P /r\n'


This generates an error :

SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'login'.
NULL

Any work around please!

--------------------------
Joins are what RDBMS's do for a living

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-08-14 : 09:04:47
resolved
if you are using Windwos ID: replace -U and -P with -T

exec master.dbo.xp_cmdshell 'bcp Northwind..table out maudit_%date:~4,2%_%date:~7,2%_%date:~10,4%.txt /c -T /r\n'


--------------------------
Joins are what RDBMS's do for a living
Go to Top of Page
   

- Advertisement -