question

venkatreddy avatar image
venkatreddy asked

error while executing script file through cmd window

hi all,

I have installed SQL server in the local machine,i want to execute a script file through command window editor.I have the script file 'samplescript.sql' on the desktop.my command is

C:\>sqlcmd -E -Srvreddy\principal -ic:\samplescript.sql

im getting the error as

sqlcmd: 'c:\samplesctipt.sql': invalid filename. 

Is there anything wrong in my syntax? Im using windows authentication here.

Thanks in advance..

sql-server-2005subjectiveclient-tools
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

forgot to mention, rvreddy is my server name,principal is instance name.
0 Likes 0 ·

1 Answer

· Write an Answer
David Wimbush avatar image
David Wimbush answered

C:\ isn't the path to your desktop. That will be buried in C:\Documents and Settings or, if you have roaming profiles, on some network share. Try moving the file to C:.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.