Hello - I am trying to use sqlcmd in a BAT file.
Could someone help me out by letting me know why my input parameter doesn't work - below are my steps.
FileA.bat works, FileB.bat does not.
FileA.bat
FileB.bat
FileA.bat returns the results of the query, FileB.bat does not.
- contents of C:\Folder\InputFile.sql
The difference between FileA & FileB is that FileA uses Q- and FileB uses i-
How can I get FileB.bat to work with -i?
Thanks in advance
Dave
Could someone help me out by letting me know why my input parameter doesn't work - below are my steps.
FileA.bat works, FileB.bat does not.
FileA.bat
Code:
sqlcmd -S (local) -d DBA -Q"DBCC ShowContig With TableResults,ALL_Indexes" -o"C:\Folder\OutputFile.txt"
FileB.bat
Code:
sqlcmd -E -S (local) -d DBA -i "C:\Folder\InputFile.sql"
-o"C:\Folder\OutputFile.txt"
FileA.bat returns the results of the query, FileB.bat does not.
- contents of C:\Folder\InputFile.sql
Code:
DBCC ShowContig With TableResults,ALL_Indexes
The difference between FileA & FileB is that FileA uses Q- and FileB uses i-
How can I get FileB.bat to work with -i?
Thanks in advance
Dave