DBPro Variable Problem

  • Anyone out there using the Visual Studio Team Edition for Database Professionals or DBPro?

    If so, have you tried implementing variables to control your builds and deployments? I have. Thanks to Gert Drapers article on variables, I've got it working. However, I can't seem to change the values of the variables on the fly. I thought I could do something like this:

    msbuild /t:sqlbuild /p:Configurations=Sandbox;drive="C:";directory="some directory" myproject.dbproj

    Then, when I want to build or deploy to a different configuration with the data stored in other places, I could do this:

    msbuild /t:sqlbuild /p:Configurations=Dev;drive="T:";directory="some other directory" myproject.dbproj

    Except when I do this, a script like this:

    FILENAME = N

    '$(drive)\$(directory)\mydb_data_2.ndf',

    Still uses the default values from the original variable defintions:

    <

    PropertyGroup>

    <SetVariables>

    <Variable Name="drive" Value="C:" />

    <Variable Name="directory" Value="Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA" />

    </SetVariables>

    </PropertyGroup>

    So I'm stuck until I can figure this out. Unless one you has the solution... Please.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • You need to map the Value to an MSBuild property and then you can pass the MSBuild property on the command line.

    Please use the MSDN forums, since we can not keep up with the external forums.

    -GertD

    http://blogs.msdn.com/gertd


    Thanks,
    -GertD@SQLDev.Net

  • Thanks for the response.

    I did post this also on MSDN. I just came over here for third party help. I didn't expect to see you.

    I also posted the question here:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1263062&SiteID=1

     

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

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