bcp command in sql 2008
-
Hi, What is wrong with this syntax? I have used this so many times in sql 2005. Kind of new to sql 2008. === bcp "Select * From Webs.About" queryout mytest.dat -T -c === the error message is Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'queryout'.
-
Hi, What is wrong with this syntax? I have used this so many times in sql 2005. Kind of new to sql 2008. === bcp "Select * From Webs.About" queryout mytest.dat -T -c === the error message is Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'queryout'.
-
Hi, What is wrong with this syntax? I have used this so many times in sql 2005. Kind of new to sql 2008. === bcp "Select * From Webs.About" queryout mytest.dat -T -c === the error message is Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'queryout'.
Also, make sure you are running the bcp utility from the command prompt. I think if you try running it from a new query window within SMS that is exactly the error you will get. I'm pretty sure the quotation marks I mentioned in my previous post won't help unless the file name has a space in it.
-NP Never underestimate the creativity of the end-user.
-
Also, make sure you are running the bcp utility from the command prompt. I think if you try running it from a new query window within SMS that is exactly the error you will get. I'm pretty sure the quotation marks I mentioned in my previous post won't help unless the file name has a space in it.
-NP Never underestimate the creativity of the end-user.
-
Sure, you can use xp_cmdshell to run a bcp command from a query window. You might have to first turn on the ability for SSMS to use a Windows command shell as it is usually off by default. If needed, run the following commands first: EXEC sp_configure 'show advanced options', 1 RECONFIGURE EXEC sp_configure 'xp_cmdshell', 1 RECONFIGURE Then run your xp_cmdshell using: EXEC xp_cmdshell '(your bcp command here)' If needed, turn back off the ability to use Windows command shell with: EXEC sp_configure 'xp_cmdshell', 0 RECONFIGURE EXEC sp_configure 'show advanced options', 0 RECONFIGURE
-NP Never underestimate the creativity of the end-user.