Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and Drop .sql scripts into SQL Management Studio 2008 does NOT work?

In SQL 2000 / Query Analyser, i used to be able to drag-n-drop T-SQL script files from Windows Explorer onto Query Analyser.

Cannot do the same in SQL 2008 / Management Studio ?

I can obviously do: File / Open / File... Navigate to the file Then Open it.

But someone please tell me there is an easier way just like in 2000 !

EDIT 16/7/10: Finally got to try on home PC, works as expected. Workplace has some restrictions (NT user policies) on a/c login. With Query Analyser, i 'Run As' another a/c and drag-drop works under logged-in user; With Management Studio, i 'Run As' another a/c and drag-drop does not work under logged-in user.

like image 477
joedotnot Avatar asked Jul 01 '10 01:07

joedotnot


People also ask

How do I import a .SQL file into SQL Server Management Studio?

Open SQL Server Management Studio. Connect to an instance of the SQL Server Database Engine or localhost. Expand Databases, right-click a database (test in the example below), point to Tasks, and click Import Flat File above Import Data.

How do I run a SQL script in SQL Server 2008 Management Studio?

Open SQL Server Management Studio > File > Open > File > Choose your . sql file (the one that contains your script) > Press Open > the file will be opened within SQL Server Management Studio, Now all what you need to do is to press Execute button.

How do I drag and drop in SQL?

To drag and drop textLeft-click the highlighted text and continue holding down the mouse button. Move the mouse cursor to the destination where you want to place the text. Release the mouse button to drop the text.

How do I run a .SQL file in Management Studio?

In the Connect to Server dialog box, in Server name, select the name of your SQL server instance, and then click Connect. In Microsoft SQL Server Management Studio, on the menu, select File > Open > File. In the Open File dialog box, browse for the script file, and then click OK.


1 Answers

This works fine for me?

It's possible that this is some sort of permissions issue - if you are running Management Studio under any sort of elevated permissions then I believe Windows will prevent drag and drop operations.

like image 121
Justin Avatar answered Sep 28 '22 08:09

Justin