A simple SQL Server Management Studio (SSMS) extension for pasting data copied from the Results window as formatted comma-separated values into another query’s IN clause.
Download the latest release and unzip the archive to Management Studio’s extensions folder. There will be a warning message from SSMS the first time it starts. Select “No” and restart SSMS. The extension will work properly from then on. For more information please check the Installation guide.
Execute a query in the SSMS query window.
Copy the ids from the Results window.
Use the command to paste them between the parentheses of another query’s IN clause.
For more information check the Wiki.