-1

I have a table with a lot of data in the development environment. I want to generate an SQL Script for data load in production.

Using the function to generate the script in SQL Server, I can only see the split based on tables. Some tables have millions of records. I like to split this data script into multiple scripts.

Is there a configuration for that?

3
  • 3
    Using the function - what function? ' I like to split this data script into multiple scripts.' - what does this mean? Commented Aug 2, 2024 at 8:25
  • 1
    Are you talking about the "Generate Scripts" functionality in SSMS with data included? Doing millions of single row inserts won't be a good way of doing this anyway (especially if they are all running as standalone autocommit transactions) Commented Aug 2, 2024 at 8:32
  • You can look here perhaps stackoverflow.com/questions/37003017/… it seems that SMO which ssms uses have option to enumerate scripts, although i'm not sure if it's enumerable by sql statement or sql statement type Commented Aug 2, 2024 at 9:20

1 Answer 1

2

You could create a view table as a work around, this will be be two virtual tables, one holding the top half and the other view table holding the bottom half.

Sign up to request clarification or add additional context in comments.

2 Comments

In this case, the procedure doesn't generate le script for data for view
Wouldn't the scripts then have stuff like: insert into ViewTable1... Insert into ViewTable2... code which needs to be replaced?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.