One of the features of the T-SQL stored procedure editor window that you might find especially helpful is the ability to execute arbitrary T-SQL code. As shown in Figure 5.12, you can create a "new stored procedure" to open a blank query window and enter whatever T-SQL you need to execute. Next, select one or more lines to execute, right-click, and choose "Run Selection". This executes the code (or tries to) and writes the output to the Database Output window (shown in Figure 5.11). This also means you can paste in or populate the T-SQL stored procedure editor from a batch file and execute the T-SQLincluding the GO separators. Figure 5.12. Run Selection executes code from the stored procedure code editor.Tip Run Selection is available in Standard Edition or better. |