SSMS 2005 and ssmssqlproj project files

  • Does anyone know how to stop SSMS saving associated connection information in script files that reside in projects?

    To reproduce...

    1. Add a new SQL Server Script project

    2. Add a new query

    3. Save

    4. Look at the ssmssqlproj file which has saved the AssociatedConnectionMoniker, AssociatedConnSrvName and AssociatedConnUserName values.

    By default my environment always saves this in the ssmssqlproj file

    <LogicalFolder Name="Queries" Type="0" Sorted="true">

    <Items>

    <FileNode Name="SQLQuery1.sql">

    <AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:SERVERNAME:True</AssociatedConnectionMoniker>

    <AssociatedConnSrvName>SERVERNAME</AssociatedConnSrvName>

    <AssociatedConnUserName />

    <FullPath>SQLQuery1.sql</FullPath>

    </FileNode>

    </Items>

    </LogicalFolder>

    which is taken from the Connections folder. This means that if you then add the project to source control every time you make a change to any script it can potentially edit the ssmssqlproj file depending on what connection you are using or if another user edits the file.

    The only time the ssmssqlproj should change is when you add, delete or rename queries.

    Ideally I would like it never to save AssociatedConnectionMoniker, AssociatedConnSrvName and AssociatedConnUserName.

    Thanks in advance

  • I'm wondering if you ever found an answer to this. I have the same frustration in SQL 2008 R2.

  • Unfortunately I didn't and this inexplicable flaw meant SSMS projects were completely unusable for us. I say inexplicable because SSMS and TFS are both Microsoft products and simply don't work together. It beggars belief.

    We now use Visual Studio 2008 Database Projects which are integrated * with TFS but carry the massive disadvantage of being outside SSMS. I've setup shortcuts that map to the local paths to make opening source controlled files in SSMS easier but it's still a pain.

    If anyone has enter a better solution I would appreciate hearing it.

    * We have an intermittent bug with this setup where adding new files to the project sometimes doesn't check it out. Rare but very annoying when it happens

  • For SQL 2008 R2 projects I remove the connections logical folder from the project file in Notepad.

    This allows for the scripts to be edited by multiple developers without

    needing to store the connection.

    The downside is that this workaround no longer works in SQL 2012.

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

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