sqlcmd

  • Hi All,

    I am a newbie to sqlserver.I recently came across "sqlcmd"utility feature while surfing.So here is my doubt.

    I connect to a server using some credentials.I do it like

    --->Right click on ssms

    --->Run as different user

    --->give some credentials(domain/password)

    How can I do the same using command prompt..When do we actually use "sqlcmd"feature.Please help me on this.It would be helpful

  • mithunc23 (6/29/2013)


    Hi All,

    I am a newbie to sqlserver.I recently came across "sqlcmd"utility feature while surfing.So here is my doubt.

    I connect to a server using some credentials.I do it like

    --->Right click on ssms

    --->Run as different user

    --->give some credentials(domain/password)

    How can I do the same using command prompt..When do we actually use "sqlcmd"feature.Please help me on this.It would be helpful

    You cab open a cmd shell under another security context same way you opened SSMS. Find a shortcut to cmd.exe, or to to cmd.exe in c:\windows\system32, right click and choose run as different user.

    sqlcmd is a command line tool to interact with SQL Server. SSMS is a GUI tool. With sqlcmd we can issue interactive commands, or we can have sqlcmd compile an entire saved script against an instance for us. It is quite versatile. It also supports tokens inside SQL scripts so they can be made to be dynamic and more portable across environments.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply