Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using SQL 2005, and was helping someone debug a connection issue today. I thought that I could view my current connection string from inside SQL Management Studio, but can't seem to figure out how to make it happen.

Is this possible? Google hunting has been fruitless.


share|improve this question
up vote 0 down vote accepted

You can't view your current SQL Management Studio connection string from within SQL Management Studio.

You could whip up your own connection string pretty quickly using the same details as when connecting to your SQL instance. Here's a resource with examples which might be helpful:

Hopefully I understood your question correctly...?

share|improve this answer
If you know for sure that I can't, then that's my answer. Finding a connection string isn't my issue - I just thought they'd have made it easy to see my current connection string in SSMS, like you can in Visual Studio. Odd. – Ducain Oct 5 '10 at 1:12
This sucks. Why not? – Colonel Panic Mar 15 '12 at 14:08

You can. From Stack Exchange:

    'data source=' + @@servername +
    ';initial catalog=' + db_name() +
    case type_desc
        when 'WINDOWS_LOGIN' 
            then ';trusted_connection=true'
            ';user id=' + suser_name()
from sys.server_principals
where name = suser_name()
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.