I set the name of the database I want to create via the command line and save it as a variable:

String inputDatabase = GetDatabaseName(args); 

From the document query.sql I read the following query:

  "ALTER DATABASE [{0}] SET READ_COMMITTED_SNAPSHOT ON;ALTER DATABASE [{0}] SET ALLOW_SNAPSHOT_ISOLATION ON;"; 

How do I “bind” the inputdatabase variable to {0} in the request?

Perhaps my question is not correct, I will be grateful for the comments.

    1 answer 1

     String inputDatabase = GetDatabaseName(args); String sqlTemplate = "ALTER DATABASE [{0}] SET READ_COMMITTED_SNAPSHOT ON;ALTER DATABASE [{0}] SET ALLOW_SNAPSHOT_ISOLATION ON;"; String sql = string.Format(sqlTemplate, inputDatabase); 
    • Thanks, works :) - olmar102