Why is it that opening .sql files in a project requires signing in each time?

  • My boss is taking the summer off for some internship he's working on, so I've got to cover for him. One of the many things he does is runs reports. He's written several SQL reports, and some of these are in SQL Server projects. He's given me the locations, etc. I've got documentation as to how to run them.

    OK, so far, so good. One thing I really hate about these SQL projects is that whwhenever open up one of the many .sql files he's written, it requires me to log into SQL server all over again. Given the fact that several of his SQL projects require opening up numerous .sql files, I really am getting tired of all of the multiple logins. However, each of these separate .sql files are really for separate, functional steps and therefore I suppose shouldn't be combined into 1 large .sql file. Is there any way to stop having to log into SQL Server when opening each and every .sql file I have to, that's a part of his SQL project files?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • If you have an active connection, you can open all of them without issue. Is there a reason you can't make one connection and leave it open?

  • Steve Jones - SSC Editor (5/16/2011)


    If you have an active connection, you can open all of them without issue. Is there a reason you can't make one connection and leave it open?

    Umm. Well, truthfully, I kind of thought the connection was opened once I got into SSMS. I didn't realize that apparently it did a "OK, you're on, good luck" and then go away on me. So, how do I get it to connect once and stay on?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • It stays connected for me. It might drop overnight, but it seems if I'm opening stuff within a few hours of each other, it remains connected.

  • Are you running the RTM version of SSMS 2005? That was the case with the original version, to present 'look, we're more secure this way', but after everyone howled about it, existing connections were reused when opening new windows.

    -Eddie

    Eddie Wuerch
    MCM: SQL

  • It also depends on how you have your environment set up. You can find it in Tools-> Options. I use "Open Empty Environment" so I don't have to log into a query window first thing. But I also have a multi-cluster environment that I open up the servers in Object Browser every morning. Note: Having database servers in Object Browser opens a connection. Saving them in Registered Servers does not.

    If I hit New Query while in an open Query window (with an open connection), it opens the new window without the login. Same if I'm in the Summary window on one of the database server objects (tables, SQL Server Agent, database, etc.). Summary Window is F7, once you've connected to a server in Object Browser.

    However, if I'm in AS or IS in the Summary window or Object Browser window, SSMS will force me to open a new connection.

    Also, if you're using SQL Logins, it will force you to log in every time (I believe).

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • There is one other detail you might need to be aware of:

    The object browser can be connected to an instance of SQL Server and each individual query window can be connected to a different instance of SQL Server. You may not have more than one instance of SQL Server so this may not be a potential issue for you. If you have more than one instance of SQL Server, and depending on how you do your work, you may need to ensure that your individual query windows are connected to the correct instance of SQL Server.

    LC

  • Eddie Wuerch (5/16/2011)


    Are you running the RTM version of SSMS 2005? That was the case with the original version, to present 'look, we're more secure this way', but after everyone howled about it, existing connections were reused when opening new windows.

    -Eddie

    Perhaps that's what's wrong. I am the developer version of SQL 2008 R2 on my machine, so I use SSMS from that to reach our production servers, which are all SQL 2005 RTM. Although I think my boss, who is running SQL 2005 on his system, has experienced the same behavior.

    Kindest Regards, Rod Connect with me on LinkedIn.

Viewing 8 posts - 1 through 7 (of 7 total)

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