ssis deployment

deepika omer 1 Reputation point
2021-07-29T06:19:22.317+00:00

Hi,

I have 10 lower enviroment and every package connected with linked server database, so whenever I deployed the package I need to change the database name.

Now the requirement is I need to remove hardcoded database name from the ssis package. so that whenever any deployment happen at that time I don't need to change the database name.

Can someone help me on this.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,578 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,639 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,861 Reputation points
    2021-07-29T12:31:59.01+00:00

    Hi @deepika omer ,

    You probably using 4 part <server>.<database>.<schema>.<table> way while using linked servers in your queries.

    It is possible to switch to the following format:

    SELECT *  
    FROM OPENQUERY ( LINKED_SERVER, 'select * from PERSONNEL');  
    

    This way database name is not mentioned. You just need to keep linked server names consistent across all the environments. Additionally, you will gain some performance benefits.

    0 comments No comments

  2. Erland Sommarskog 111.4K Reputation points MVP
    2021-07-29T14:51:35.203+00:00

    Hm. OPENQUERY presumes that the linked server has been set up with the default database to be desired database. Else you have to specify the database in the query inside OPENQUERY.

    This is certainly a workable solution as a linked server is essentially an alias. But it does require server-level configuration, which involves someone with server-level permissions. Which can add complexity. Or be perfectly trivial.

    In any case, it does not address issues with database.dbo.tbl, that is cross-database queries on the same instance.

    I would say that from a T-SQL perspective, synonyms are better. You can say:

    CREATE SYNONYM dbo.myremotetable FOR LINKEDSERVER.db.dbo.tbl
    CREATE SYNONYM dbo.otherdbtable FOR db.dbo.tbl
    

    There is still an issue with setting up the synonyms, which you may have to do dynamically for each downlevel environment.

    It is possible that there is a better solution inside SSIS, but I don't know SSIS, so I cannot answer that part.

    of


  3. ZoeHui-MSFT 36,586 Reputation points
    2021-07-30T07:36:33.053+00:00

    Hi @deepika omer ,

    Try to parameterize the Server Name and Initial Catalog (database name) in a connection string for packages in a project.

    Details you may refer:

    parameterizing-database-connection-sql-server-integration-services

    Regards,

    Zoe


    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.
    Hot issues October

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.