From: Muhammad Bilal on
Hi.
Is it possible to provide Server Name, Username and password at run time
instead of writing it in the batch file?

Regards,
Muhammad Bilal

From: John Bell on
On Tue, 3 Aug 2010 00:14:03 -0700, Muhammad Bilal
<MuhammadBilal(a)discussions.microsoft.com> wrote:

>Hi.
>Is it possible to provide Server Name, Username and password at run time
>instead of writing it in the batch file?
>
>Regards,
>Muhammad Bilal

Hi

I assume you are calling SQLCMD in the batch file so you can do
something like

SQLCMD -S %1 -U %2 -P %3 -i fred.sql

You can also set SQLCMDSERVER, SQLCMDUSER and SQLCMDPASSWORD
environment variables instead of passing them as parameters.

John