Thursday, March 29, 2012

Drag & Drop Multiple Query Files Into Management Studio

In SQL Server 2000, you could have a Query Analyzer (QA) query window open to a particular database, and drag and drop a group of query files from Windows Explorer on it. QA would then open a query window for each of the files, and automatically default it to that database.

I am trying to get the same functionality in SQL Server 2005 Management Studio, but it nags me with the "Connect to Database Engine" dialog box for every file. Worse still, it will not default to the same database being used by the query window on which it was dropped. And to add insult to injury, it makes you click the options button to change to other than the default database. The behavior is the same in both the tabbed and MDI environment.

I have looked for settings that would affect this behavior, but didn't notice any. Does anyone know if this behavior is possible with 2005? If so, how to you implement it? Thanks.

Kevin

Did you find an answer to your problem? I have just started using SQL Server 2005 and I am having the same problem.

Thanks

Danny

|||

Even if I use "open file" to open saved queries I get asked each time to connect to the database engine. What am I doing wrong?

Thanks

Danny

|||Unfortunately I still have not found a way around the problem. I assume it's something we will have to live with.|||

One of the solutions would be to create a SQL Project with connection info and the related query files as members of a the project. This is similar to the VS project model

You can have multiple projects with different connection settings in a solution.
You may also be able to leverage the new SQLCMD internal commands to embed the connect statement within your scripts.

Thanks,
Ramesh

|||There must be an easier solution to this. Shocking!|||

Please raise a suggestion at the product feedback centre

http://lab.msdn.microsoft.com/ProductFeedback

|||Added a suggestion - http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackId=FDBK48385

No comments:

Post a Comment