This morning I went to look at the Program files in C: drive (WRSA.exe), but could not open the files. I made sure any of the 'protect against process termination' or 'protect against process tampering' etc. Options were unchecked in the Webroot dashboard. After you download your desired exe on your Android phone, just download and install Inno Setup Extractor from the Google Play Store, then use a file browser to locate the exe file, and then open.
Active3 months ago
Below is an example of the BCP Statement.I'm not accustomed to using BCP so your help and candor is greatly appreciated
I am using it with a format file as well.
If I execute from CMD prompt it works fine but from SQL I get the error.The BCP statement is all on one line and the SQL Server Agent is running as Local System.The SQL server, and script are on the same system.
Not Able To Open Any Exe Files Windows 7
I ran exec master..xp_fixeddrivesC,45589E,423686
I've tried output to C and E with the same result
Here is the format file rmax-c.fmt
Due to formating in this post the last column of the format file is cut off but reads
ErrorNotFoundExceptionSQL_Latin1_General_CP1_CI_AS
for each column other that documentdate. 2,2972121 gold badges7474 silver badges139139 bronze badges
user2747607user2747607
10 Answers
First, rule out an xp_cmdshell issue by doing a simple 'dir c:*.*';
Check out my blog on using BCP to export files.
I had problems on my system in which I could not find the path to BCP.EXE.
Either change the PATH variable of hard code it.
Example below works with Adventure Works.
Before changing the path to 110 for SQL Server 2012 and the name of the database to [AdventureWorks2012], I received the following error.
After making the changes, the code works fine from SSMS. The service is running under NT AUTHORITYLocal Service. The SQL Server Agent is disabled. The output file was created.
CRAFTY DBACRAFTY DBA10.9k33 gold badges1818 silver badges2525 bronze badges
Does the output path exist? BCP does not create the folder before trying to create the file.
Try this before your BCP call:
Daniel MolnarDaniel Molnar
Please check, the file might be opened in another application or program.If it is the case, bcp.exe cannot overwrite the existing file contents.
In my case, I solved The problem in the following way:
my command was :
My FileNameWithDirectory was too long. like
'D:project-abcR&Dabc-608FilesNeededFilesNeededDataFilesabc.csv'
. I change into a simpler directory like :
'D:abc.csv'
Problem solved.
So I guess the problem occurred due to file name exceeding. thus the file was not found.
Md Kauser AhmmedMd Kauser Ahmmed
If it works from the command line but not from the SQL Agent, I think it is an authentication issue.
The SQL Server Agent is running under a account. Make sure that the account has the ability to read the format file and generate the output file.
Also, make sure the account has the ability to execute the xp_cmdshell stored procedure.
Write back with your progress ...
CRAFTY DBACRAFTY DBA10.9k33 gold badges1818 silver badges2525 bronze badges
Remove no_output from your command, if you use one offcourse
Stefan MichevStefan Michev2,93311 gold badge2727 silver badges2424 bronze badges
In my case this fix was simply running in administrator mode.
Arthur SwailsArthur Swails
In case anyone else runs into the same problem: I had
...lesPerson' queryout'
rather than ...lesPerson' queryout '
Patrick SchomburgPatrick Schomburg
If your code is writing the data file, and then reading it with BCP, make sure that you CLOSE THE DATA FILE before trying to read it!
Failure to do so gives: 'Unable to open host>11 gold badge99 silver badges1818 bronze badges
I received this after I shared my output folder, even when there were no files open.
I created a new, unshared folder for output and all was fine.(might help someone ;-))
CatherineCatherine