2012年3月27日星期二
BCP using Win Authentication
I would like to do a BCP out command in an automated job using WIndows
Authentication and would like to provide the id similar to providing a SQL
authentication id using the -U switch
I know there is a -T switch but that works in interactive mode and i want
something that can work in batch mode
Thanks
Hi,
> I would like to do a BCP out command in an automated job using WIndows
> Authentication and would like to provide the id similar to providing a SQL
> authentication id using the -U switch
TRY Task Scheduler.
(It protect your password!)
SHINICHI YONEDA MXL04371@.nifty.ne.jp
Microsoft Most Valuable Professional
MVP for SQL Server 2002-2005
|||> I know there is a -T switch but that works in interactive mode and i want
> something that can work in batch mode
The '-T' parameter works with all BCP modes.
Hope this helps.
Dan Guzman
SQL Server MVP
"Sanjay" <Sanjay@.discussions.microsoft.com> wrote in message
news:60DC798B-E724-444B-A0DB-15296824127C@.microsoft.com...
> Hi
> I would like to do a BCP out command in an automated job using WIndows
> Authentication and would like to provide the id similar to providing a SQL
> authentication id using the -U switch
> I know there is a -T switch but that works in interactive mode and i want
> something that can work in batch mode
> Thanks
>
|||You CAN NOT provide an Integrated Login. To work with Windows
Authentication, your "Batch" must be "Logged In" to the network. Now, there
are several ways to do this:
Create an application service.
Write your batch as DCOM or COM+ component.
Use Windows Task Scheduler.
Sincerely,
Anthony Thomas
"Sanjay" <Sanjay@.discussions.microsoft.com> wrote in message
news:60DC798B-E724-444B-A0DB-15296824127C@.microsoft.com...
Hi
I would like to do a BCP out command in an automated job using WIndows
Authentication and would like to provide the id similar to providing a SQL
authentication id using the -U switch
I know there is a -T switch but that works in interactive mode and i want
something that can work in batch mode
Thanks
BCP using Win Authentication
I would like to do a BCP out command in an automated job using WIndows
Authentication and would like to provide the id similar to providing a SQL
authentication id using the -U switch
I know there is a -T switch but that works in interactive mode and i want
something that can work in batch mode
ThanksHi,
> I would like to do a BCP out command in an automated job using WIndows
> Authentication and would like to provide the id similar to providing a SQL
> authentication id using the -U switch
TRY Task Scheduler.
(It protect your password!)
--
SHINICHI YONEDA MXL04371@.nifty.ne.jp
Microsoft Most Valuable Professional
MVP for SQL Server 2002-2005|||> I know there is a -T switch but that works in interactive mode and i want
> something that can work in batch mode
The '-T' parameter works with all BCP modes.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Sanjay" <Sanjay@.discussions.microsoft.com> wrote in message
news:60DC798B-E724-444B-A0DB-15296824127C@.microsoft.com...
> Hi
> I would like to do a BCP out command in an automated job using WIndows
> Authentication and would like to provide the id similar to providing a SQL
> authentication id using the -U switch
> I know there is a -T switch but that works in interactive mode and i want
> something that can work in batch mode
> Thanks
>|||You CAN NOT provide an Integrated Login. To work with Windows
Authentication, your "Batch" must be "Logged In" to the network. Now, there
are several ways to do this:
Create an application service.
Write your batch as DCOM or COM+ component.
Use Windows Task Scheduler.
Sincerely,
Anthony Thomas
"Sanjay" <Sanjay@.discussions.microsoft.com> wrote in message
news:60DC798B-E724-444B-A0DB-15296824127C@.microsoft.com...
Hi
I would like to do a BCP out command in an automated job using WIndows
Authentication and would like to provide the id similar to providing a SQL
authentication id using the -U switch
I know there is a -T switch but that works in interactive mode and i want
something that can work in batch mode
Thankssql
2012年3月8日星期四
bcp failed when special characters {;" were used in the password from command line in Win 2
bcp worked with password in normal characters, but failed with {;"
I tried for SQL 2005 and SQL 2000, from Window 2003 SP1. Is this a bug?
When the special character { was used in the password, bcp failed with Native error 0.
>>
F:\ftp\log\Cases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P{
SQLState = 08001, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied
SQLState = 01S00, NativeError = 0
Warning = [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
>>
When the special character ; or " was used in the password, bcp failed with Native error 18456.
>>
F:\ftp\log\Cases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P;
SQLState = 28000, NativeError = 18456
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sem5'.
F:\ftp\log\Cases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P"
SQLState = 28000, NativeError = 18456
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sem5'.
>>
Could you try :
bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P"{"|||
I tried the followings but it didn't work.
bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P"{"
bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P'{'
bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P\{
I opened a case and got an answer.
Based on the Microsoft SQL Server 2005 online help for “Strong Passwords[SQL Server]”,
>>
if used in an OLE DB or ODBC connection string, a login or password must not contain the following characters: [] {}() , ; ? * ! @.. These characters are used to either initialize the connection or separate connection values.
>>
As the result, SQL Server Enterprise Manager allows all special characters but the OLE DB or ODBC connection is different.
|||Thanks for following up your own post. It helps others when you share your solution.