I use to open server explorer and click on a table. Then there is a little
icon on the top of the window, with the text SQL. Click it. Here you have a
window to write sql scripts in. To run them, just press ctrl+r.
There is for sure an easier way to do this, but i have never heard of it