How execute SELECT query in Sql server Post-Deployment Script

  • Hi,

    How execute SELECT query in Sql server dacpack Post-Deployment Script.

    Is it possible conditional statement (IF statement) in Post-Deployment Script ?

    Thanks in advance

    Regards

    Binu

  • hi,

     

    anybody can help...

     

    Regards

    binu

  • hi,

     

    anybody can help

     

    Regards

    binu

  • Can you explain what it is you are trying to do?

    Adam Zacks-------------------------------------------Be Nice, Or Leave

  • i think you need to execute a script after the dacpac deployment.

    a dacpac will create tables and objects, but there's no scripting involved, so no, no script can be appended to the dacpac.

    a script can contain all the logic you desire, and that's where you might have conditional scripts based on s ervername, environment, time or anything else you want to test for, and use logic to execute.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I cannot see how executing a SELECT query in a post-deployment script will achieve anything useful. Where are you expecting the SELECTed data to go?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Lowell wrote:

    i think you need to execute a script after the dacpac deployment. a dacpac will create tables and objects, but there's no scripting involved, so no, no script can be appended to the dacpac. a script can contain all the logic you desire, and that's where you might have conditional scripts based on s ervername, environment, time or anything else you want to test for, and use logic to execute.

    This is not necessarily correct. If you develop your database in SSDT, adding a post-deployment script is a straightforward task. When this database is Published, a DACPAC is created which contains the post-deployment script. The PD script is executed as part of the Publish action.

    • This reply was modified 5 years, 5 months ago by  Phil Parkin.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply