January 3, 2017 at 2:30 pm
Hello,
I am trying to export data from our staging environment to a .txt file on my local machine. I am using CMD Prompt for this. When I execute the cmd below, I get the error...
"The system cannot find the file specified"
Any help would be greatly appreciated!
sqlcmd -S STAGE -d DB -E -Q ""select * from TABLE where cast(time as date) between '2016-11-01' AND '2016-11-30'"" -o ""c:\MyData.txt"" -h-1 -s""<TAB>"" -w 700
The are no problems, only solutions. --John Lennon
January 3, 2017 at 2:34 pm
Lord Slaagh (1/3/2017)
Hello,I am trying to export data from our staging environment to a .txt file on my local machine. I am using CMD Prompt for this. When I execute the cmd below, I get the error...
"The system cannot find the file specified"
Any help would be greatly appreciated!
sqlcmd -S STAGE -d DB -E -Q ""select * from TABLE where cast(time as date) between '2016-11-01' AND '2016-11-30'"" -o ""c:\MyData.txt"" -h-1 -s""<TAB>"" -w 700
the root ofd the c drive is often locked down from being touched by most accounts, try putting it in a c:\temp or c:\data sub folder instead
if you connect tot eh server, paths on the server refer to the SERVER, not your local C:\drive, so you need a UNC path to get to your machine:
\\LordSlaagh\c$\SharedFolder\MyData.txt
that UNC requirement means the service account running on the server has to be a domain account, and have permissions to your machine too...you might still hit a permissions issue with error 5
Lowell
January 3, 2017 at 2:41 pm
Thanks Lowell.
Is this supposed to be a shared drive? Can it work without? My companies security is locked down, unfortunately.
The are no problems, only solutions. --John Lennon
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply