Thursday, 26 November 2020

[SQL Server] Copy and paste column names of the table using Object Explorer in SSMS

Get column names(parameter names) using Object Explorer in SSMS

Template Explorer contains lots of SQL Example Scripts maybe you want to create. 

Situation

I want to type column tables from the table easily. 
Typing all columns manually is not really efficient. (Maybe that's why you type "*" ).

Copy and paste column names using Object Explorer

New query.


Maybe you want to put "*" in there. But please wait.

Open Object Explorer and expand to "Columns"


Now, drag and drop that "Columns" to SQL Query Window.


Voila, all column names pasted to Query Window.


 

Copy and paste Parameters of Stored Procedure using Object Explorer

You can also get parameters of stored procedure with the same method.
drag and drop "Parameters" from Object Explorer to Query Window.

Parameters will be there.


What about the other objects?

As you can imagine, most of the objects from Object Explorer can be copied to Query Window.
But there's bug to copying "Constraints". SSMS might die when you try to drag and drop "Constraints" to Query Window.


References




(KOR)☁️ AWS Solutions Architect Associate 자격증 취득 여정

  !저의 경험 , 팁 , 그리고 SAA-C03 자격증 합격을 위한 노하우 공유! 조금 늦은 포스팅이지만 , 꼭 공유하고 싶었던 이야기입니다 . 회사 내 주변 동료들이 자주 이렇게 말하곤 했습니다 . “ 님 실...