Testing anything with SQL as the Destination !

Testing anything with SQL as the Destination !

So as a DBA I often get told "SQL isn't working..." I used to get frustrated as it implies I didn't do my job right and telling people it isn't SQ, well thats the issue isn't it really, it just created a series of fence throwing activities without making progress.

Instead I have been looking at ways to connectivity test locally with SQL as the destination to help debug (prove its not) SQL.

The first tool I draw everyone's attention to is SQLCMD, its so lightweight and available in most OS versions it can be used by anyone to test connectivity to SQL.

Start by installing it using the link above, does not matter which OS you are on just chose the appropriate file, then call it from Powershell/Bash/CMD.

Once open you can start running some commands to try and connect

Windows Authentication vanilla attempt

sqlcmd -S UKATEST123,1433

A basic little script which will attempt to connect on the default port using with Authentication as the current user.

SQL Authentication

sqlcmd - S UKATEST123,1433  -U Kurt -P Kurtspasssword 

Once connected you can then run anything as though you are in SQL server Management Studio, maybe try this to check its working

Select @@Servername 
Select getdate()

Naturally you can then start doing more complex things, it works for Listeners, different ports you can even use runas to run a CMD/PS/Bash window as the Service account you want to connect to SQL for to get an even better

No alt text provided for this image

In summary, this is a great tool to help test connectivity to a SQL server, useful for helping Networks debug connectivity, Operational bods check that connectivity is there, Application developers can find SQL and interact with it.





要查看或添加评论,请登录

Kurtis Lamb的更多文章

  • Regression and Rebuild Testing Your Infrastructure As Code

    Regression and Rebuild Testing Your Infrastructure As Code

    Ahhh regression testing, a by-product of software development and often thought about but never implemented! What if I…

  • If You Want To Change The World, Start Off By Making Your Bed

    If You Want To Change The World, Start Off By Making Your Bed

    I must watch this video once a month at least, like a classic book its a constant reminder to take each step as it…

    7 条评论
  • Building Rockets

    Building Rockets

    One of the presentations I never got to do (due to Lock down) was on Building Rockets and how we can learn good…

  • Rapidly Develop, Debug and Resolve Incidents using OODA Loop

    Rapidly Develop, Debug and Resolve Incidents using OODA Loop

    As part of my planning for "Mic Drop" sessions we do here at Transunion UK I am working on a number of presentations…

  • Changing SQL Server Collation - IT CAN BE DONE!

    Changing SQL Server Collation - IT CAN BE DONE!

    A problem I come across regularly enough for me to write an article about it, is SQL server Collation and setting it up…

  • Isn't It A Good Thing Standards Evolve?

    Isn't It A Good Thing Standards Evolve?

    So we have all heard the Phrase "They have left now so blame them" when looking back through old code and normally when…

  • SQL Server Availability Groups,Seeding Failures and How To Re-Trigger Seeding

    SQL Server Availability Groups,Seeding Failures and How To Re-Trigger Seeding

    I love AAG! In fact its the one feature I always push when recommending an upgrade to existing SQL Server…

  • Password Change Day

    Password Change Day

    As a DBA I often have to connect to legacy systems in different domains as well as maintain a bunch of credentials!…

    1 条评论
  • My First Year - Coming to a close

    My First Year - Coming to a close

    For those of you close to me you will know, I made the decision to leave Lloyds Banking Group in May 2018 to move to a…

    3 条评论
  • Automation of SQL Server Install

    Automation of SQL Server Install

    I was chatting with another Redditer recently regarding automatic Installation of SQL Server using DSC and at the time…

社区洞察

其他会员也浏览了