I am using SQL Server 2008 Management Studio and have a table I want to migrate to a different db server.
Is there any option to export the data as an insert into SQL script??
I am using SQL Server 2008 Management Studio and have a table I want to migrate to a different db server.
Is there any option to export the data as an insert into SQL script??
Just updating screenshots to help others as I am using a newer v18, circa 2019.
Here you can select certain tables or go with the default of all. For my own needs I'm indicating just the one table.
Next, there's the "Scripting Options" where you can choose output file, etc. As in multiple answers above (again, I'm just dusting off old answers for newer, v18.4 SQL Server Management Studio) what we're really wanting is under the "Advanced" button. For my own purposes, I need just the data.
Finally, there's a review summary before execution. After executing a report of operations' status is shown.

For those looking for a command-line version, Microsoft released mssql-scripter to do this:
$ pip install mssql-scripter
# Generate DDL scripts for all database objects and DML scripts (INSERT statements)
# for all tables in the Adventureworks database and save the script files in
# the current directory
$ mssql-scripter -S localhost -d AdventureWorks -U sa --schema-and-data \
-f './' --file-per-object
dbatools.io is a much more active project based on PowerShell, which provides the Get-DbaDbTable and Export-DbaDbTableData cmdlets to achieve this:
PS C:\> Get-DbaDbTable -SqlInstance sql2016 -Database MyDatabase \
-Table 'dbo.Table1', 'dbo.Table2' |
Export-DbaDbTableData -Path C:\temp\export.sql