SQLCMD

  • I tried connecting to my sql instance using sqlcmd, but it gives me an error: Login failed for the user xyz.

    But I could connect to the same instance using SSMS. Can someone correct if I'm doing it wrong?

  • I was actually trying to connect to a named instance. How could I connect to a new instance using sqlcmd?

  • try

    sqlcmd -Shostname\instancename -Uuser_name -Ppassword

    Regards,
    MShenel

  • Thank you. i'm able to connect now but I'm not able to run any queries.

    I'm trying to run

    Use AdventureWorks

    Select Title From person.contact

    It gives me an error saying that "Invalid object name 'person.contact'".

    Any help?

  • Hey there, can you give us the complete command u are trying to execute?

  • Since we're not sitting at your desk, you really need to supply us with the full command that you're trying to run. Without it, there's no way for us to know what you're typing that's wrong.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 6 posts - 1 through 5 (of 5 total)

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