SQL Database/ Table Creation

SQLLover21 201 Reputation points
2020-12-02T14:16:45.213+00:00

There is a database named DB_PROD_20 in our production server. In that DB, there is a table with the following directory:

ServerName.DB_PROD_20.Schema1.TableName

I need to extract that table with the schema and the data from the PROD server to DEV server. This is what I planned to do :

  1. setting up a PS script to copy the backup file from Data warehouse
  2. create a sql agent job to restore to DEV
  3. create another job to execute a SP to clean up the data after the restore

question:

Should I create an entire new DB or create a another table under a different database name per our requirement in our DEV server?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,711 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,244 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

Accepted answer
  1. Monalv-MSFT 5,891 Reputation points
    2020-12-03T02:27:54.867+00:00

    Hi @SQLLover21 ,

    I need to extract that table with the schema and the data from the PROD server to DEV server.

    We can use the following two methods in SSIS package:

    1.We can use OLEDB Source and OLEDB Destination in Data Flow Task .

    2.We also can use Transfer SQL Server Objects Task in Control Flow .

    Please refer to the following pictures:

    Method 1:

    44388-oledbsou.png
    44527-oledbdes.png
    44528-mappingdes.png
    44593-df.png

    Method 2:

    44583-tssot1.png
    44563-tssot2.png

    Results:

    44460-sd2.png

    Best Regards,
    Mona


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Guoxiong 8,126 Reputation points
    2020-12-02T16:01:10.19+00:00

    I would suggest to create a DDL script for that table if it does not exist in DEV and then to export data to the file. This way it is easier to import data to the table in DEV.

    0 comments No comments