dbTalk Databases Forums  

Default behaviour when opening .sql files

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Default behaviour when opening .sql files in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Hickin
 
Posts: n/a

Default Default behaviour when opening .sql files - 12-08-2009 , 10:50 AM






Hi All,

As a dba, I spend a lot of of time opening .sql files. I've just moved from
XP to windows 7.0 and am suffering with a small change in behaviour that is
quite irritating.

Previously, on my xp machine, I could open Management Studio using Run As
(my admin account), then select the server in Object Explorer, switch to
windows explorer, and open the file. The file would then be opened in the
open instance of management studio, and the new query window would have the
selected server as the connection. This was cool.

Now, in Windows 7, it always opens the sql file in a new instance of
Management Studio. The problem for me in this case, is that I need Management
Studio to be running as a different user.

Does this sound familiar to anyone? Any workarounds?


Mark

Reply With Quote
  #2  
Old   
Jeffrey Williams
 
Posts: n/a

Default Re: Default behaviour when opening .sql files - 12-08-2009 , 08:59 PM






Instead of clicking on the file - just drag it to the open instance of SSMS.
And yes, you can drag it to the icon in the task bar and Windows will bring
up SSMS so you can finish dragging the file.

"Mark Hickin" <MarkHickin (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi All,

As a dba, I spend a lot of of time opening .sql files. I've just moved
from
XP to windows 7.0 and am suffering with a small change in behaviour that
is
quite irritating.

Previously, on my xp machine, I could open Management Studio using Run As
(my admin account), then select the server in Object Explorer, switch to
windows explorer, and open the file. The file would then be opened in the
open instance of management studio, and the new query window would have
the
selected server as the connection. This was cool.

Now, in Windows 7, it always opens the sql file in a new instance of
Management Studio. The problem for me in this case, is that I need
Management
Studio to be running as a different user.

Does this sound familiar to anyone? Any workarounds?


Mark






Reply With Quote
  #3  
Old   
Mark Hickin
 
Posts: n/a

Default Re: Default behaviour when opening .sql files - 12-09-2009 , 02:54 AM



Actually, that doesn't work either when SSMS is running under a different
user account.

In fact I am reasonably certain that all of this has to do with the fact
that SSMS is being run under a different user account to that which I am
logged in as.

"Jeffrey Williams" wrote:

Quote:
Instead of clicking on the file - just drag it to the open instance of SSMS.
And yes, you can drag it to the icon in the task bar and Windows will bring
up SSMS so you can finish dragging the file.

"Mark Hickin" <MarkHickin (AT) discussions (DOT) microsoft.com> wrote in message
news2D9A181-4FBA-4107-B869-80CB721615DB (AT) microsoft (DOT) com...
Hi All,

As a dba, I spend a lot of of time opening .sql files. I've just moved
from
XP to windows 7.0 and am suffering with a small change in behaviour that
is
quite irritating.

Previously, on my xp machine, I could open Management Studio using Run As
(my admin account), then select the server in Object Explorer, switch to
windows explorer, and open the file. The file would then be opened in the
open instance of management studio, and the new query window would have
the
selected server as the connection. This was cool.

Now, in Windows 7, it always opens the sql file in a new instance of
Management Studio. The problem for me in this case, is that I need
Management
Studio to be running as a different user.

Does this sound familiar to anyone? Any workarounds?


Mark






Reply With Quote
  #4  
Old   
Mark Hickin
 
Posts: n/a

Default Re: Default behaviour when opening .sql files - 12-09-2009 , 09:58 AM



Hi,

I got the bottom of this problem.

I'll clarify what was happening here, just in case anyone runs into this in
the future.

Problem:
On Windows 7, if you run SSMS as a different user to the one that you are
logged in as, then opening a .sql file by clicking on a link, or double
clicking on a file will fail (operation could not be completed). Dragging
files onto SSMS is also not permitted. For me this causes issues, as I
release sql files into test etc via links in emails, Jira. Not being able to
do this is incovenient as I would have to download the file, save it
somewhere, go into SSMS, select the correct server, and open the file. Not a
problem if done occassionally, but if it's something you do many times a day,
quite annoying.

Solution:
This seems to be a problem that is caused by UAC. I am yet to fully explore
the effect various UAC settings, but turning it off certainly allows files to
be opened simply by clicking them.

Mark

Reply With Quote
  #5  
Old   
Jeffrey Williams
 
Posts: n/a

Default Re: Default behaviour when opening .sql files - 12-09-2009 , 08:48 PM



I am running Windows 7 - I open SSMS using SysInternals ShellRunAs with my
domain credentials, while connected using VPN. I select a file and drag it
to SSMS in the taskbar and it opens in the version that is already open.

I am not sure what is happening on your system, but it works perfectly fine
on mine.

"Mark Hickin" <MarkHickin (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I got the bottom of this problem.

I'll clarify what was happening here, just in case anyone runs into this
in
the future.

Problem:
On Windows 7, if you run SSMS as a different user to the one that you are
logged in as, then opening a .sql file by clicking on a link, or double
clicking on a file will fail (operation could not be completed). Dragging
files onto SSMS is also not permitted. For me this causes issues, as I
release sql files into test etc via links in emails, Jira. Not being able
to
do this is incovenient as I would have to download the file, save it
somewhere, go into SSMS, select the correct server, and open the file. Not
a
problem if done occassionally, but if it's something you do many times a
day,
quite annoying.

Solution:
This seems to be a problem that is caused by UAC. I am yet to fully
explore
the effect various UAC settings, but turning it off certainly allows files
to
be opened simply by clicking them.

Mark

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.