I want to get a backup of a single table with its data from a database in SQL Server using a script.
How can I do that?
select * into mytable_backup from mytable
Makes a copy of table mytable, and every row in it, called mytable_backup.
This query run for me ( for MySQL). mytable_backup must be present before this query run.
insert into mytable_backup select * from mytable
Backup a single table with its data from a database in sql server 2008
SELECT * INTO [dbo].[tbl_NewTable]
FROM [dbo].[tbl_OldTable]
You can use the "Generate script for database objects" feature on SSMS.
This one solved my challenge.
Hope this will help you as well.
Try using the following query which will create Respective table in same or other DB ("DataBase").
SELECT * INTO DataBase.dbo.BackUpTable FROM SourceDataBase.dbo.SourceTable
There are many ways you can take back of table.