未加星标

SQL SERVER SSMS Script Out Multiple Objects

字体大小 | |
[数据库(mssql) 所属分类 数据库(mssql) | 发布者 店小二03 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

Have you ever driven your car out in the direction of your office by mistake when it was supposed to be a day off? Have you ever done things unconsciously because you are getting trained for something that is common? This is what I call as human nature and how our brain works. Our brain is a complex organ and it used patterns and preset paths of execution when it is pre-occupied. This is the path of least resistance and it may sometimes not be the best option too. In this blog post we will learn how to script out multiple objects in SQL Server.

If you are wondering why I am talking about this. Let me give you an example on a tool that I used almost every single day SQL Server Management Studio (SSMS). I use the Object Explorer and multiple other windows that are available. I get intrigued how this tool works because there is something to learn or unlearn when it comes to working with SSMS.

I was talking with a junior DBA and he wanted to script out multiple objects. My initial reaction was to guide him and he would learn. I told him to do it using SSMS. After an hour he came back and told me it is not possible. It was important for me to show him how. I asked him to do the steps on my PC.


SQL SERVER   SSMS   Script Out Multiple Objects

He opened the Object explorer and said he could right click each object and script out. He could use a wizard etc. But he said it was not an easy step. He claimed to have worked with some 3 rd party tool in the past that did help him. But I insisted there is something he was missing and I did have an old trick that I wanted to show him.

I opened in the same window the “Object Explorer Details” (F7 shortcut). In this window, I selected multiple objects (based on where the cursor is in Object Explorer and showed how we can export the script.


SQL SERVER   SSMS   Script Out Multiple Objects

As shown above, it is a simple script that got generated in one step and he was surprised it was hidden in SSMS. He was trying to use the CTRL, SHIFT keys on the Object Explorer pane to select multiple objects and it failed. He assumed now that it was not possible. He said he is going to explore SSMS further and there were areas that he was not aware.

Have you ever used this feature before? Been there with SSMS for years now. I find it handy and felt this was lesser appreciated feature.

Reference: Pinal Dave ( http://blog.sqlauthority.com )

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

主题: SQLSQL Server
分页:12
转载请注明
本文标题:SQL SERVER SSMS Script Out Multiple Objects
本站链接:http://www.codesec.net/view/520449.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(34)