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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With