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.
Author |
Topic |
cable_si
Starting Member
20 Posts |
Posted - 2008-09-03 : 08:00:25
|
Hi AllWe have just upgaded our old sql server from 2000 to a 2005 cluster serverI am now having problems running some bcp commandsThe command i am running isexec master..xp_cmdshell 'bcp "select fileoutput from [new_db]..[Invoice_Table] order by roworder" queryout c:\invoice\template\customer.html -c -o c:\invoice\template\bcpOutput.txt' the error i am getting isUser name not provided, either use -U to provide the user name or use -T for Trusted Connectioni have tried to add in -U and -P but then get the belowSQLState = 08001, NativeError = 2Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2]. SQLState = HYT00, NativeError = 0Error = [Microsoft][SQL Native Client]Login timeout expiredSQLState = 08001, NativeError = 2Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.Can anyone help at all ? |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-09-03 : 09:18:30
|
Did you enable xp_cmdshell on Surface area Config? |
|
|
cable_si
Starting Member
20 Posts |
Posted - 2008-09-03 : 09:26:18
|
Hixp_cmdshell is enabled and is working fine |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-09-03 : 10:27:02
|
you didn't specify a server in this command. that means by default bcp.exe will try to connect to the local default (unnamed) instance. if there is no unnamed instance you'll get the login timeout error.bcp "select fileoutput from [new_db]..[Invoice_Table] order by roworder" queryout c:\invoice\template\customer.html -c -o c:\invoice\template\bcpOutput.txtis this running on a named instance? if so you need to add a -SSERVER\INSTANCE flag to the bcp command. elsasoft.org |
|
|
cable_si
Starting Member
20 Posts |
Posted - 2008-09-03 : 11:57:56
|
HiIt is running a named instance, i have tried adding inexec master..xp_cmdshell 'bcp "select fileoutput from [new_db]..[Invoice_Table] order by roworder" queryout c:\invoice\template\customer.html -c -o -STCSQL1\sqlcluster c:\invoice\template\bcpOutput.txt' but i get the same error |
|
|
|
|
|