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 |
|
d@nish
Starting Member
3 Posts |
Posted - 2008-12-11 : 10:40:36
|
| I am using following command: exec master..xp_cmdshell 'bcp "select * from cab.useraudit" queryout "c:\test.xls" -c -T'Executing this command gives following error: "Error = [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."What might be wrong? |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
d@nish
Starting Member
3 Posts |
Posted - 2008-12-11 : 11:04:46
|
quote: Originally posted by X002548 exec master..xp_cmdshell 'bcp "select * from cab..useraudit" queryout "c:\test.xls" -c -T'????
I need to export this query result to the mentoned excel file. I am generating similar statement dynamically in a stored procedure. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
d@nish
Starting Member
3 Posts |
Posted - 2008-12-11 : 11:13:25
|
| I have already tried that. That doesnt helps. |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-12-11 : 12:41:23
|
quote: Originally posted by d@nish I have already tried that. That doesnt helps.
Does it give you an error if you run this ?exec master..xp_cmdshell 'bcp "select * from sysobjects" queryout "c:\test.xls" -c -T' If not, then follow the instructions here and then run your original query-http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|