Converting Select results into Insert script – SQL Server

Here is another method, which may be easier than installing plugins or external tools in some situations: Do a select [whatever you need]INTO temp.table_namefrom [… etc …]. Right-click on the database in the Object Explorer => Tasks => Generate Scripts Select temp.table_name in the “Choose Objects” screen, click Next. In the “Specify how scripts should … Read more

Removing the remembered login and password list in SQL Server Management Studio

Another answer here also mentions since 2012 you can remove Remove cached login via How to remove cached server names from the Connect to Server dialog?. Just confirmed this delete in MRU list works fine in 2016 and 2017. SQL Server Management Studio 2017 delete the file C:\Users\%username%\AppData\Roaming\Microsoft\SQL Server Management Studio\14.0\SqlStudio.bin SQL Server Management Studio … Read more

How to connect to LocalDb

I am totally unable to connect to localdb with any tool including MSSMA, sqlcmd, etc. You would think Microsoft would document this, but I find nothing on MSDN. I have v12 and tried (localdb)\v12.0 and that didn’t work. Issuing the command sqllocaldb i MSSQLLocalDB shows that the local instance is running, but there is no … Read more

Format SQL in SQL Server Management Studio

Late answer, but hopefully worthwhile: The Poor Man’s T-SQL Formatter is an open-source (free) T-SQL formatter with complete T-SQL batch/script support (any DDL, any DML), SSMS Plugin, command-line bulk formatter, and other options. It’s available for immediate/online use at http://poorsql.com, and just today graduated to “version 1.0” (it was in beta version for a few … Read more