Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2013
    Posts
    4

    Unanswered: Running a Sqlcmd Command from Another Machin on Server

    I want to run a command from a pc to a remote server, here is my situation:
    I have sql server 2008 on my server. I do not have sql server on my pc
    I want to run a sqlcmd command from my pc to my server
    sqlcmd -S serevrname\instancename,1433 -E -d dbname -i c:\myfolder\myscript.sql -o c:\myfolder\Myoutput.txt
    Myscript.sql is a simple query of my database. I put sqlcmd command in a batch file on c: drive of server
    When I run the batch file from my server it works, but it does not work when I run it from my pc

    To see what is the problem I did this:
    on the command ile on my pc I typed : \\serevername\c$ then I have a full access on the server from my pc. Then I run the batch file on c: drive on server, and I get bellow error:
    Sqlcmd: Error: Error occurred while opening or operating on file c:\myfolder\myscript.sql (Reason: The system cannot find the path specified):eek: any help would be really appreciated

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Can you use the original SQL Server distribution media (CD, MSI, ISO, etc.) to install the SQL Client Tools onto your workstation? That would make things a lot easier.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •