Reputation:
I've Help table in our Dev Database and I'm just wondering how I can create script table data so that I can easily copy all my Help table data and paste it in our QA database Help Table?
I've used Simple Data Scripter extension but the output script is not the same format like what we have for other tables so just wondering if there is a way I can get the same data script format like the other for my Help Table.
// This is the original format that we have. I want the Help table to look like this too
--- Inserting Help type ---
insert into [dbo].HelpType (Id, Name) values(1, 'Help');
//This is what it look when I use Simple Data Scripter extension
--- Inserting Help ---
insert [Help] ([Id],[Name],[ParentId],[Text],[CreatedDate],[UpdatedDate],[Types])
select 1,'Deep Dive into Workspace',NULL,NULL,'2021-03-05 17:24:53.0000000',NULL,1 UNION ALL
Upvotes: 3
Views: 5786
Reputation: 6043
You can install Database Administration Tool Extensions for Windows
on Azure Data Studio, this extension provides The Generate Scripts Wizard
feature.
When installed this tool, you can right click on your database node.
Select the specific table for which we need the script. We can select multiple objects as well for scripting:
In the next page, you’ll find scripting options like:
If you require to generate scripts for data only. We do not want object scripts in the generated script. For this requirement, make the following changes in the advanced scripting options:
It will generate script as follows format:
INSERT [dbo].[emp] ([id], [name], [age]) VALUES (1, N'John', 29)
INSERT [dbo].[emp] ([id], [name], [age]) VALUES (2, N'Tom', 28)
INSERT [dbo].[emp] ([id], [name], [age]) VALUES (3, N'Tiny', 26)
Upvotes: 5