filmov
tv
How to Select and Edit Vertical Blocks in SSMS - SQL Server / T-SQL Tutorial Part 9

Показать описание
Select and Edit Vertical Blocks in SSMS -SQL Server / T-SQL Tutorial
Scenario:
We often come to situation where we need to make same changes to multiple line of code. This is great feature to make quick change to tsql script.
Take a look into below script,I would like to change Testdb1 to testdb2 for first three queries. We might think that we can use Find and Replace, that can be used but we have to replace one item at a time as our each query is using Testdb1. By using SSMS Edit Vertical Blocks feature we can replace Testdb1 with testdb2 for three queries quickly.
Use master
go
Solution:
It is simple to use , How down the Alt key and then select area you would like to select.
Once the area is selected, Type the new word you would like to use, in our case we want to replace with TestDB2.
I noticed one thing, If there will be space( line) between the queries, It will type the new word there as well. that is annoying so make sure your queries don't have space between them.
Check out our website for Different SQL Server, MSBI tutorials and interview questions
such as SQL Server Reporting Services(SSRS) Tutorial
SQL Server Integration Services(SSIS) Tutorial
SQL Server DBA Tutorial
SQL Server / TSQL Tutorial ( Beginner to Advance)
Scenario:
We often come to situation where we need to make same changes to multiple line of code. This is great feature to make quick change to tsql script.
Take a look into below script,I would like to change Testdb1 to testdb2 for first three queries. We might think that we can use Find and Replace, that can be used but we have to replace one item at a time as our each query is using Testdb1. By using SSMS Edit Vertical Blocks feature we can replace Testdb1 with testdb2 for three queries quickly.
Use master
go
Solution:
It is simple to use , How down the Alt key and then select area you would like to select.
Once the area is selected, Type the new word you would like to use, in our case we want to replace with TestDB2.
I noticed one thing, If there will be space( line) between the queries, It will type the new word there as well. that is annoying so make sure your queries don't have space between them.
Check out our website for Different SQL Server, MSBI tutorials and interview questions
such as SQL Server Reporting Services(SSRS) Tutorial
SQL Server Integration Services(SSIS) Tutorial
SQL Server DBA Tutorial
SQL Server / TSQL Tutorial ( Beginner to Advance)