SQL Server administration and T-SQL development, Web Programming with ASP.NET and Javascript, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software

Kodyaz Development Resources

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.






Surround With Feature New in SQL Server 2011 Denali CTP 1

One of the new features of SQL Server 2011 (Denali) CTP1 is the Surround With feature in Microsoft SQL Server Management Studio (SSMS). New "Surround With" enhancement in SSMS Query Editor screen makes it easier to code and edit t-sql in the Query Editor screen for sql developers.

SQL Server Management Studio Surround With improvement enables t-sql programmers to enclose a block of sql script with IF conditional statement, WHILE loop block or with BEGIN END blocks.




Free SQL Comparison tools
Trusted by thousands of users
Download your copy now



Here is a demonstration of the Surround With enhancement in programmability in SQL Server Management Studio of new SQL Server 2011 CTP1 version.

Highlight the sql script or lines of t-sql code block that you want to surround with one of the block statements and then right-click.

surround-with-in-sql-server-management-studio-query-editor

From the displayed context menu, select Surround With... option.
The short list of possible enclose options will be displayed for your choice.

Code snippet for Begin...End block.
Code snippet for If construct.
Code snippet for While loop.

tsql-script-surround-with-begin-if-while-code-snippet-sql-server

The condition to evaluate is in different color and the cursor is highlighting the condition.

sql-code-snippet-for-while-loop-in-sql-server-denali

Code snippet for Begin and End block.

code-snippet-for-begin-end-block-in-denali

Code snippet for If construct.

surround-with-code-snippet-for-if-construct-sql-server-denali

--From the list of options available in the Surround With drop down list, select the appropriate option/construct in which you want your code selected in first step to be enclosed. --This will enclose the selected code snippet (in step 1) into the selected construct (in step 2) as shown below







Related SQL Resources

SQL Server Articles

SQL Server 2012

SQL Server Tools

SQL Blog

SQL Server 2008 Blog

Certification Exams Blog

Reporting Services Blog

Analysis Services Blog

MS SQL Server Forums



Free Exam Vouchers










Copyright © 2004 - 2012 Eralper Yilmaz. All rights reserved.
Community Server, by Telligent Systems