0

I am trying to execute several sql files located in a folder by executing [Main.bat] which contains below mentioned command-

for %%G in (*.sql) do sqlcmd /S [Server] /d [database name] -U [username] -P [Password] -E -i"%%G" pause

But facing this issue-

Sqlcmd: The -E and the -U/-P options are mutually exclusive.

Any suggestion?

Praveenks
  • 1,436
  • 9
  • 40
  • 79
  • 1
    Well, **EITHER** use a user id/password (`-U .. -P`) - **OR** use the integrated security (`-E`) - you just **CANNOT** use both at the same time! – marc_s Feb 11 '13 at 05:54
  • thanks for the response! it is working now..just have one more query, i have three subfolder inside a folder..and i want this batch to execute those subfolder files also..can you please tell me how to do this? – Praveenks Feb 11 '13 at 06:26

0 Answers0