title: Generate a script of inserts from existing data with a select clause in SQL Server
body: <p>I know that in SQL Server you can right click on a database, go to tasks, generate scripts, pick a table etc. and generate a script that inserts the data into the table as shown <a href="https://stackoverflow.com/questions/10531484/how-to-export-data-from-sql-server-2008-2010-in-dml-sql-script">here</a></p>
  
  <p>Is there any way I can restrict the data that is being scripted out by specifying some select clauses? For example, I might want to script out only the top 100 rows in a table or all records from the Employees table that has an IsManager flag set.</p>
  
  <p>If I can't do it using tasks -> generate scripts functionality, is there any other alternative way or tool?</p>