|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
default database for opening a .sql file?I am using SQL Server Management Studio. Whenever I open a .sql file, it
does 2 annoying things: 1) prompts me to connect, yet again. 2) sets the database drop down to master again. The second one, in particular, is really annoying. Is there a way to change the database that it connects to when I open a .sql file? Note: setting the default database for the server worked for windows created with "New Query" but not for opening .sql files. Heh, 2 seconds after posting I stumble across it. When it prompts me to
connect, there is an Options button. I clicked it and on the Connection Properties tab it had the same "connect to database" dropdown that I used to set the default for new query windows. Now whenever I open a .sql file it goes to the right database. Show quote "Adam J. Schaff" <asch***@cascodev.com> wrote in message news:%23dCE6D4IHHA.4928@TK2MSFTNGP06.phx.gbl... >I am using SQL Server Management Studio. Whenever I open a .sql file, it >does 2 annoying things: > 1) prompts me to connect, yet again. > 2) sets the database drop down to master again. > > The second one, in particular, is really annoying. Is there a way to > change the database that it connects to when I open a .sql file? > > Note: setting the default database for the server worked for windows > created with "New Query" but not for opening .sql files. > Just be aware that the database you connect to isn't part of the .sql file. If you want to be in the
..sql file, just add USE dbname in the beginning of the file. Or, create a project including this file and the database information is in the project file. -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "Adam J. Schaff" <asch***@cascodev.com> wrote in message news:eaROZG4IHHA.2456@TK2MSFTNGP06.phx.gbl... > Heh, 2 seconds after posting I stumble across it. When it prompts me to connect, there is an > Options button. I clicked it and on the Connection Properties tab it had the same "connect to > database" dropdown that I used to set the default for new query windows. Now whenever I open a > .sql file it goes to the right database. > > "Adam J. Schaff" <asch***@cascodev.com> wrote in message > news:%23dCE6D4IHHA.4928@TK2MSFTNGP06.phx.gbl... >>I am using SQL Server Management Studio. Whenever I open a .sql file, it does 2 annoying things: >> 1) prompts me to connect, yet again. >> 2) sets the database drop down to master again. >> >> The second one, in particular, is really annoying. Is there a way to change the database that it >> connects to when I open a .sql file? >> >> Note: setting the default database for the server worked for windows created with "New Query" but >> not for opening .sql files. >> > > >I am using SQL Server Management Studio. Whenever I open a .sql file, it SQL Server 2005 Service Pack 2 will fix this problem. We just released a >does 2 annoying things: > 1) prompts me to connect, yet again. December CTP that has this improvement and many more. http://www.microsoft.com/downloads/details.aspx?FamilyID=d2da6579-d49c-4b25-8f8a-79d14145500d&DisplayLang=en Paul A. Mestemaker II Program Manager Microsoft SQL Server Manageability http://blogs.msdn.com/sqlrem/ Show quote "Adam J. Schaff" <asch***@cascodev.com> wrote in message news:%23dCE6D4IHHA.4928@TK2MSFTNGP06.phx.gbl... >I am using SQL Server Management Studio. Whenever I open a .sql file, it >does 2 annoying things: > 1) prompts me to connect, yet again. > 2) sets the database drop down to master again. > > The second one, in particular, is really annoying. Is there a way to > change the database that it connects to when I open a .sql file? > > Note: setting the default database for the server worked for windows > created with "New Query" but not for opening .sql files. > |
|||||||||||||||||||||||