Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Keeps asking to connect to server.

Author  Topic 

broscup
Starting Member

5 Posts

Posted - 2007-12-04 : 11:44:39
Okay, here goes. I have set up a few computers with sql server 2005 and 2005 express. When I got to my personal computer and set it up, everything was fine. On the other machines, when I ran a sql file (query or script?) it stayed in the current server and used the database that was selected (unless otherwise noted with the USE command). However, when I ran these same scripts on my machine, I get prompted for first to connect to the server. Then unless the script notes otherwise (USE command) it defaults to Master, instead of the selected database, like it did on the other machines. Is there somewhere I can fix this? It's just a little annoying and a bit more time consuming. Thanks in advance,

Greg (broscup)

Posted this on SQL Junkies, but you guys have a much larger forum from what I can tell.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-04 : 11:45:33
Install SP2.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

broscup
Starting Member

5 Posts

Posted - 2007-12-04 : 11:52:46
Thanks for the quick reply, but I've already tried that. However after reading that, I thought..."well, I haven't tried running the scripts since rebooting after installing SP2", however, that still did not work.

G
Go to Top of Page

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-12-04 : 12:01:00
I am not clear on your problem, how are you running the scripts, are you clicking FILE -> OPEN from SSMS or are you doing RIGHT CLICK and NEW QUERY, or are you just double clicking a script in a folder?



Future guru in the making.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-12-04 : 12:11:00
broscup, install service pack 2 for SQL Server 2005 onto your client machine. Service packs aren't only for the server, they also contain bug fixes and enhancements for the clients. The issue that you are describing was fixed in SP2.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

broscup
Starting Member

5 Posts

Posted - 2007-12-04 : 12:11:34
Okay, I must be an idiot. I know I went online yesterday and ran microsoft update, however, I must have only looked at the default (High Priority) updates, because just to make sure I ran it again, and listed under the software updates was SQL Server 2005 SP2, which I could have sworn was listed yesterday. I will try this and let you know if it works. Sorry for wasting your time if it does, and thanks for the help.


Zoroaster, I am clicking on the sql file in a folder (which works on the other machines) however I did right click on the database that I wanted to run the script on and clicked new query, then pasted the script inside there and it ran fine.

Man, I know I updated to the SP yesterday, maybe I left the Management Studio open and it was unable to update to the SP2? Who knows,

Trying again now with everything closed.

Thanks,

Greg
Go to Top of Page

broscup
Starting Member

5 Posts

Posted - 2007-12-04 : 12:56:45
Solved, SP2 was the issue, thanks everyone,

Greg
Go to Top of Page
   

- Advertisement -