Visual Studio Database Development Tools (Formerly "Database Edition Forum") ForumDiscuss Team Edition for Database Professionals, including database testing, test data generation, and database schema management.© 2009 Microsoft Corporation. All rights reserved.Wed, 25 Nov 2009 20:01:34 Z57d87e34-a13c-48ad-ae4d-e6b3655c1f8chttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/00bc1239-708b-4c23-b96d-d6726863c61dhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/00bc1239-708b-4c23-b96d-d6726863c61dRoxytoxyhttp://social.msdn.microsoft.com/Profile/en-US/?user=RoxytoxyStrange behavior during deployI am working on a GDR project that I inherited from a colleague. <br/> <br/> The issue I'm dealing with is this:<br/> <ul> <li>At one point, the project included a stored procedure, let's call it <strong>ProcA</strong> that included the following code:<strong> backup log tempdb with truncate_only</strong> </li> </ul> <ul> <li>This proc was later deleted (since SQL 2005 does not support the Truncate_only option) and a new version of the proc (<strong>ProcB</strong> ) was created and added to the project. This new ProcB did <span style="text-decoration:underline"><strong>not</strong> </span> have the Backup Log statement in it.</li> <li>The current state of the GDR project shows the new ProcB and shows no traces of the old ProcA. </li> <li>When the project is deployed, it <strong>fails </strong> with the following error message : <strong>Gen-363(330,24)Error TSD02010: Incorrect syntax near truncate_only. Proj_DB.dbschema(0,0)Error TSD01234: The application encountered an unexpected error. To diagnose this problem, enable tracing.<br/> Proj_DB.dbschema(0,0)Error TSD01234: Failed to import target model Proj_DB. Detailed message A fatal error occurred while the model was being imported.<br/> </strong> </li> <li>I ran a search in the entire GDR solution for the words 'truncate_only' and it yielded no results.</li> <li>Since I could not figure out the source of this piece of code, I turned on tracing and ran the deploy. Within the output of the trace I found that ProcA was still being included in the deployment.</li> <li>I deleted the .dbdml file assuming that there may have been traces of the old proc left behind in the model. </li> <li>It still did not work. Every time I deploy, it fails with this error message. </li> <li>Why is it still including ProcA in the deployment ?</li> </ul>Wed, 25 Nov 2009 15:30:56 Z2009-11-25T20:01:34Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b69023b2-51c3-427b-b844-169069af0947http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b69023b2-51c3-427b-b844-169069af0947Roxytoxyhttp://social.msdn.microsoft.com/Profile/en-US/?user=RoxytoxyModel Already Has an Element That Has the Same Name errorI have used Database file references (.dbschema files) to include references to objects in an external database.<br/> When I deploy this database project I see errors stating - Model already has an element that has the same name ... <br/> These errors relate to objects in the <span style="text-decoration:underline"><strong>referenced database project.</strong> </span> <br/> Both the projects build without a problem. It is only at deploy time that the errors are displayed.<br/> I started investigating the referenced database project to verify the cause of this. The objects it was complaining about related to indexes using the same name as columns in a table.<br/> So for example, if I have a table called <strong>Contact </strong> with a column called <strong>EmailAddress</strong> <br/> and I have an index called <strong>EmailAddress</strong> <br/> Is this a problem ? Why is this a duplicate element ? And why does this not complain at compile time ?<br/>Mon, 23 Nov 2009 21:25:32 Z2009-11-25T18:33:05Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b6218702-d7bb-4783-9260-04f96dc5cbb1http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b6218702-d7bb-4783-9260-04f96dc5cbb1ernmalleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=ernmalleyConfiguration settings are not being saved in the database project file<span style="color:#004040;font-size:x-small"><span style="color:#004040;font-size:x-small"> <p>The &quot;Deployment configuration file&quot; and &quot;Sql command variables file&quot; settings are not being saved correctly in our VSTS database project files. We are using VSTS GDR R2 (9.1.40413.00)</p> <p>We have a database project with 6 separate Configurations. They are called: Debug; Release; Development; TFSBuild; SystemTest and Live. We want to use the same Deployment configuration and command variables files for the first 5 of these configurations and different files for the Live configuration. So the desired mapping of configurations to files is:<br/></p> <pre>Config Deployment config file Sql command variable file =========== ============================================ ============================== Debug Properties\Tosca.Database.sqldeployment Properties\Tosca.Database.sqlcmdvars Release Properties\Tosca.Database.sqldeployment Properties\Tosca.Database.sqlcmdvars Development Properties\Tosca.Database.sqldeployment Properties\Tosca.Database.sqlcmdvars TFSBuild Properties\Tosca.Database.sqldeployment Properties\Tosca.Database.sqlcmdvars SystemTest Properties\Tosca.Database.sqldeployment Properties\Tosca.Database.sqlcmdvars Live Properties\LIVE.Tosca.Database.sqldeployment Properties\LIVE.Tosca.Database.sqlcmdvars</pre> <span style="color:#004040;font-size:x-small"><span style="color:#004040;font-size:x-small"> <p>When editing the project in VSTS we find that sometimes the changes we make to these settings do not get saved to the database project file.</p> <p>For example, we can</p> <p>- open the Properties window for the database;</p> <p>- choose the Release Configuration,</p> <p>- select the appropriate files from the combo boxes,</p> <p>- click Save,</p> <p>- close the Properties window,</p> <p>- reopen the Properties window,</p> <p>- select the Release Configuration again</p> <p>- <strong><em>and the files we selected are lost. Instead VSTS shows: Properties\Database.sqldeployment and Properties\Database.sqlcmdvars</em>.</strong></p> <p>Is this a known bug or am I missing something obvious? At the moment this has caused us to suspend use of database projects due to the resultant loss of productivity and confidence. I would be keen to resume, but cannot until we know what is going on with this.</p> </span></span></span></span>Wed, 25 Nov 2009 15:25:33 Z2009-11-25T15:25:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/22e12535-bfbb-4870-b1a3-1b2dfa1d263ahttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/22e12535-bfbb-4870-b1a3-1b2dfa1d263aRaguramanhttp://social.msdn.microsoft.com/Profile/en-US/?user=RaguramanTSD03006: User: [X] has an unresolved reference to Login [X]Hi Friends,<br/> <br/> When i try to create data base project with LARGE data base I am getting this error : <strong>TSD03006: User: [X] has an unresolved reference to Login [X]</strong> <br/> <br/> User 'X' i have created for our own purpose.  <br/> <br/> I have given reference this user in all stored procedures and functions, so I don't want to remove this user<br/> <br/> Can you please someone help?<br/> <br/> Thanks<br/> Ragu<br/>Mon, 23 Nov 2009 17:32:15 Z2009-11-25T14:11:29Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a445f07b-5be8-41d3-bba3-ba747a19de61http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a445f07b-5be8-41d3-bba3-ba747a19de61T. Baxterhttp://social.msdn.microsoft.com/Profile/en-US/?user=T.%20Baxter?? Missing the "Data Generation Plan" in VS 2008 ??<p align=left><font face=Verdana size=3>Hi All,<br><br>I have Visual Studio Database Edition (Visual Studio 2008, SP1) installed <br>and I'm trying to create a Data Generation Plan according to these <br>instructions:<br><br></font><a title="mhtml:{15316594-C1DB-419A-9A13-7724088BDF8D}mid://00000009/!x-usc:http://msdn.microsoft.com/en-us/library/aa833237.aspx"><font face=Verdana size=3>http://msdn.microsoft.com/en-us/library/aa833237.aspx</font></a><br><br><font face=Verdana size=3>My problem is that I do not have a Data Generation Plans node in Solution <br>Explorer. I cannot add a Data Generation Plan. The Data Generation Plan does <br>not exist.<br><br>Does anyone have an idea on how to fix this? </font></p>Tue, 16 Sep 2008 16:02:20 Z2009-11-25T13:31:30Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/6d69e3fb-8aee-422e-8e0f-aa815fe85152http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/6d69e3fb-8aee-422e-8e0f-aa815fe85152Database Guyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Database%20GuyTSD04105 and TSD03006 - Trying to reference across databases but getting this error in VSTS DB Edition 2008 GRUHello - I've seen this mentioned in slightly different ways across the board but was really hoping someone could either help. I've got a database project, and have imported all the objects into it. Some of the views have references to another database on the sql server such as<br/> <br/> select * from db2.dbo.table<br/> <br/> However I was getting TSD03006 errors. So I tried creating a dbschema file of the db2 database, and then added as a reference in the original project. That kinda helped but then for similar stored procs and views I get TSD04105. The only reason I did this was because using Add Database Reference would not work.<br/> <br/> So the question, should I try to create a master sql project and put both database projects into the master. Will that allow me to have the cross database references without all the name collision problems. I really don't want to rename all my views in one database just so I can get a clean build.<br/> <br/> Thanks much for any help.<br/> <br/> D. Shapiro<br/> LondonMon, 23 Nov 2009 22:42:44 Z2009-11-25T09:25:55Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/034de041-8bf1-4be7-ad97-0af75775e415http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/034de041-8bf1-4be7-ad97-0af75775e415bsstricklandhttp://social.msdn.microsoft.com/Profile/en-US/?user=bsstricklandRemove from Project doesn't work -- file is still in the project fileI am trying to clean up a project. There are hundreds of uneccessary files that I have chosen to &quot;Remove from Project&quot; to get a good build. However, about 70 of the files I have removed from the project remain in the .dbproj file. They don't show up in the Solution Explorer, but when I build, they are causing errors. I manually went into the dbproj file and removed one of the files and rebuilt. That file is no longer causing an error.<br/><br/>Is there a bug or a glitch, or have I missed something?Fri, 20 Nov 2009 23:35:51 Z2009-11-24T22:16:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/2c799c22-a4aa-484a-8641-073f569ca1efhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/2c799c22-a4aa-484a-8641-073f569ca1efAntoine Fhttp://social.msdn.microsoft.com/Profile/en-US/?user=Antoine%20Fmsbuild Recovering from Failed Deployments<p>Is there a supported mechanism to allow a rollback the whole process if any part of the deployment generates and error.<br/><br/>Currently, msbuild seems to rollback if the error comes from the database design update.  However, it does not seem to rollback if the error comes from pre or post deployment scripts.<br/><br/>Is this a misunderstanding on my part or is there an option/setting I overlooked?</p>Fri, 20 Nov 2009 15:29:26 Z2009-11-24T20:46:02Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b9ada1d8-b2fe-4cdd-a87a-3870307ca260http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b9ada1d8-b2fe-4cdd-a87a-3870307ca260Greg Frickehttp://social.msdn.microsoft.com/Profile/en-US/?user=Greg%20FrickeUpdate existing database using latest dbschema and vsdbcmd tries to alter mdfWhen I try to do a vsdbcmd deploy using my latest dbschema, the resulting script tries to alter the mdf file, which results in the sql failing because the database is in use.  Is there a way to avoid the alter mdf statement from generating in the deployment script?   <div><br/></div> <div>This alter is appearing I feel because the $DatabaseName references in the dbschema file doesn't match the statically named file on the server, so it tries to alter it to the $DatabaseName</div> <div><br/></div> <div>This is in GDR2</div>Thu, 05 Nov 2009 16:25:42 Z2009-11-24T20:42:07Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/9dbbf147-0791-43a2-8ebc-4fd19d8960c7http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/9dbbf147-0791-43a2-8ebc-4fd19d8960c7Roxytoxyhttp://social.msdn.microsoft.com/Profile/en-US/?user=RoxytoxyRole memberships get droppedI have a solution that is made up of multiple composite projects. I have one project <strong>RBSecurity </strong> containing the security objects - users, roles and role memberships. I have another project <strong>RBDatabase </strong> containing the user objects and code: tables, views, functions, procs etc.<br/> The <strong>RBDatabase </strong> project makes a reference to the <strong>RBSecurity </strong> project.<br/> The deploy order is such: <strong>RBSecurity </strong> Project, <strong>RBDatabase </strong> Project.<br/> The RBDatabase project has the 'Drop objects in target but not in project' option checked / enabled. <br/> When I deploy the <strong>RBDatabase </strong> project (NOTE: I don't deploy the solution - I only deploy the project), the role memberships defined in the RBSecurity project get <span style="text-decoration:underline"><strong>dropped</strong> </span> . <br/> Why should that happen ? Since the <strong>RBSecurity </strong> project is a composite project, all the objects contained within it should be considered part of the complete database model. It appears though that the <strong>RBDatabase </strong> project is not aware of the existence of the role memberships and therefore drops them from the target during the deploy because of the Drop setting being enabled. No other objects are being dropped - only the role memberships.<br/> I checked the project settings to verify if the option 'Ignore role memberships' was enabled - but that was not the case.<br/> Can you please explain this behavior ?<br/>Fri, 23 Oct 2009 15:07:20 Z2009-11-24T20:17:25Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/e82cd44d-3686-4a17-9736-5c9b33b5f38ehttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/e82cd44d-3686-4a17-9736-5c9b33b5f38eGert Drapershttp://social.msdn.microsoft.com/Profile/en-US/?user=Gert%20DrapersMSDB reference projects<p align=left>The references projects for MSDB are finally available on MSDN Code Gallery</p> <p align=left><a title="http://code.msdn.microsoft.com/dbpromsdbsamples" href="http://code.msdn.microsoft.com/dbpromsdbsamples">http://code.msdn.microsoft.com/dbpromsdbsamples</a></p> <p align=left>-GertD</p>Wed, 30 Apr 2008 05:41:01 Z2009-11-24T18:19:48Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b6723695-0bad-4fea-b863-48ab712e2627http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b6723695-0bad-4fea-b863-48ab712e2627Ron Howehttp://social.msdn.microsoft.com/Profile/en-US/?user=Ron%20HoweColor me silly. What does GDR stand for? Subject says it all.Tue, 28 Oct 2008 17:24:09 Z2009-11-24T17:19:46Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/91c22c93-aba7-4827-8e12-06542a4b8121http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/91c22c93-aba7-4827-8e12-06542a4b8121AndyKrhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndyKrCan we continue to use DB Pro 2005 with Visual Team Suite 2008?It appears that our plan to upgrade from DB Pro 2005 to DB Pro 2008 has been scuppered by the fact that the 2008 version does not preserve comments outside of the code block. This means (for us) that we cannot use it. <br/><br/>However my company still wants to upgrade to Visual Studio Team Foundation Suite 2008 and I am struggling to find something that definitively states that we could do so and continue to use an integrated DB Pro 2005 for our database management. <br/><br/>Could someone confirm or deny for me please?<hr class="sig">-- Andy KramekFri, 21 Aug 2009 14:35:34 Z2009-11-24T16:33:57Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/dae5e140-c058-4646-bb21-641bca4a14achttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/dae5e140-c058-4646-bb21-641bca4a14acRaguramanhttp://social.msdn.microsoft.com/Profile/en-US/?user=RaguramanTables and stored procedure are not created Hi friends,<br/> <br/> I am totally new to data base projects.<br/> <br/> I having an issue: tables and stored procedures are not created when creating <span>Isolated Database Development Environment.  <br/> <br/> I have specified SOURCE and TARGET databases.  When i look into TESTDb (data base name within the project) i dont see any tables/stored procedures there.<br/> <br/> Can you please some one help me?<br/> <br/> Thanks in advance<br/> <br/> Ragu</span>Mon, 23 Nov 2009 17:15:50 Z2009-11-24T16:29:51Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/359ed84f-be9f-41e1-b6fd-2c3b29bd3c9dhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/359ed84f-be9f-41e1-b6fd-2c3b29bd3c9dbccollinhttp://social.msdn.microsoft.com/Profile/en-US/?user=bccollinPretty big bug in database project schema compareThe below only happens when I have ignore database collation on for schema compare: <div><br/></div> <div>Go to my database using Sql Management studio. Add a new column to a table and add a default value of ((0)).</div> <div>Save the table</div> <div>Go to the database project and do a schema compare to update the project using the differences from the database.</div> <div>Write Updates</div> <div><br/></div> <div>The new constraint file for the default does not get created in the project.</div> <div>The project somehow still thinks the file is there however, if I go to the table, and delete the column when I try and build the database project it complains that the constraint cannot be applied to a column that doesn't exist.</div> <div>When I double click the error it takes me to a file that is the contraint file. So the file is on the hard drive, but it never got added to the project. I cannot find anywhere in the project where it is referencing this file to include in the build. So now since I cannot delete the file from the project, and I cannot find where the project is referencing this file(even using find in all files) my database project is now effectively broken and I can no longer build.</div> <div><br/></div> <div>The above works perfectly fine when I do not have &quot;Ignore database collation&quot; on.</div> <div><br/></div> <div>I am using visual studio 2008 on windows 7</div>Fri, 20 Nov 2009 14:48:37 Z2009-11-24T16:27:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/eeec47f2-6932-4c53-a1a9-1c95400466d0http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/eeec47f2-6932-4c53-a1a9-1c95400466d0Greg Frickehttp://social.msdn.microsoft.com/Profile/en-US/?user=Greg%20FrickeFile script with variable for file size fails to compile, is this supported scenario?<div>I want to replace the file size of my database file with a variable.  This is because we are deploying this database and running ETLs from the source system to populate this database every night.  Some environment have huge datasets, others very small, so we want to initialize the file to an appropriate size.  This is the file script in my storage/files folder:</div> <div> <div><br/></div> <div>ALTER DATABASE [$(DatabaseName)]</div> <div>    ADD FILE (NAME = [$(DatabaseName)_Data], FILENAME = '$(DefaultDataPath)$(DatabaseName)_Data.mdf', SIZE = <strong>$(DefaultDataSize)</strong> KB, MAXSIZE = UNLIMITED, FILEGROWTH = 500000 KB) TO FILEGROUP [PRIMARY];</div> <div><br/></div> </div> <div>Whenever I try to compile I get the error: TSD02010: Incorrect syntax near $(DefaultDataSize)  </div> <div><br/>If I replace it with 300000 then I have no problems.</div> <div><br/>Is this not a supported scenario?</div> <div><br/></div> <div><br/></div> <div><br/></div> <div><br/></div>Tue, 24 Nov 2009 16:06:46 Z2009-11-24T16:20:09Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/62cddf10-32fa-40b2-bf0f-0eda333ccfbdhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/62cddf10-32fa-40b2-bf0f-0eda333ccfbdSeanHawkeshttp://social.msdn.microsoft.com/Profile/en-US/?user=SeanHawkesExport to Tsql Editor Grayed out after GDR upgrade and Schema compare I just upgraded to VS 2008 GDR, from VS 2008 database edition.  I then converted an existing 2008 project.  I then did a schema compare and it shows the results, many more results and options which I love, but I only am able to &quot;Write Updates&quot; the &quot;Export To Editor&quot; button is grayed out.  What am I doing wrong?  This was steps that I would do before I upgraded to the GDR.<br><br>Thanks,<br>SeanFri, 12 Dec 2008 21:13:33 Z2009-11-24T14:11:31Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/f5c394aa-c786-4257-a7df-cff6e9942da5http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/f5c394aa-c786-4257-a7df-cff6e9942da5Mulanaphyhttp://social.msdn.microsoft.com/Profile/en-US/?user=MulanaphySqlDeployTask Failed in GDR 2008  I recently upgraded my existing DB Pro 2005 project to the GDR 2008.  After the upgrade I created a server project, and second database project to handle the permissions for my DEV environment.  I can get the solution to build successfully but each time it gets to the deploy task it fails with this error message:<br><br><font size=1> <p><font style="font-size:11px"><b>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(120,5)Error MSB4018: The &quot;SqlDeployTask&quot; task failed unexpectedly.</b></font></p> <p><font style="font-size:11px"><b>System.InvalidOperationException: Nullable object must have a value.</b></font></p> <p><font style="font-size:11px"><b>at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)</b></font></p> <p><font style="font-size:11px"><b>at Microsoft.Data.Schema.Tasks.DBDeployTask.Execute()</b></font></p> <p><font style="font-size:11px"><b>at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp; taskResult)</b></font></p> <p><font style="font-size:11px"><b>Done executing task &quot;SqlDeployTask&quot; -- FAILED.</b></font></p> <p><font style="font-size:11px"><b>Done building target &quot;DspDeploy&quot; in project &quot;PVE.dbproj&quot; -- FAILED.</b></font></p> <p><font style="font-size:11px"><b>Done executing task &quot;CallTarget&quot; -- FAILED.</b></font></p> <p><font style="font-size:11px"><b>Done building target &quot;DBDeploy&quot; in project &quot;PVE.dbproj&quot; -- FAILED.</b></font></p> <p><font style="font-size:11px"><b>Done building project &quot;PVE.dbproj&quot; -- FAILED.<br><br></b><font style="font-size:12px"><br><br>If I take the build scripts and run them against the server they all complete successfully, so I have some confidence that they are correct but it just seems to fail on the build.  Any ideas?</font><br><br>Thanks,<br>Dave</font></p></font>Tue, 09 Dec 2008 21:18:30 Z2009-11-24T10:43:57Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/beaae56e-234b-4216-bcf5-e8c2b8bf25e2http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/beaae56e-234b-4216-bcf5-e8c2b8bf25e2Daniel Snidermanhttp://social.msdn.microsoft.com/Profile/en-US/?user=Daniel%20SnidermanHow do I deploy my database?I'm getting the &quot;TSD01268: .Net SqlClient Data Provider: Msg 1834&quot; as described in serveral posts on this forum - but either I don't understand the explaination - or the &quot;workaround&quot; isn't working for me.  I'm trying to automate build and deploy for this project - so I'm not sure what steps to take other than &quot;Manually edit the SQL script after it's generated (which is hardly an automated solution)<br/><br/>I've edited the scripts in the storage folder to use the variables for the <span style="font-size:x-small">[$(DatabaseName)] and <span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">$(DefaultDataPath) </span></span></span>and make sure all the settings exactly match the server - yet every time I try to run a deployment I get the error.  <br/><br/>I've ensured the settings match by running a schema compmare and exporting the settings.  Note that the generated scripts don't use the variable name - so I manually edit those back (especially since there is a need to control this - so we can have multiple copies on the same server).<br/><br/>Is there any solution to this problem other than excluding the storage scripts from the database project?<br/><br/>Please let me know if you need any additional information.<br/><br/>Thanks<br/><br/>Dan<br/><br/><span style="font-size:xx-small"> <p>Deployment script generated to:</p> <p>C:\directbuy\DirectBuy NGE\Source\Main\DirectBuyDB\DirectBuy.VSR.Main\sql\release\DirectBuy.VSR.Main.sql</p> <p>Creating DirectBuy.VSR.Main.DPS...</p> <p>DirectBuy.VSR.Main.dbschema(0,0)Error TSD01268: .Net SqlClient Data Provider: Msg 1834, Level 16, State 1, Line 1 The file 'D:\Program Files\Microsoft SQL Server\MSSQL10.NGEDEV\MSSQL\DATA\DirectBuy.VSR.Main.DPS.mdf' cannot be overwritten. It is being used by database 'DirectBuy.VSR.Main.DPS'.</p> <p>DirectBuy.VSR.Main.dbschema(0,0)Error TSD01268: .Net SqlClient Data Provider: Msg 1828, Level 16, State 4, Line 1 The logical file name &quot;DirectBuy.VSR.Main.DPS&quot; is already in use. Choose a different name.</p> <p>An error occurred while the batch was being executed.</p> <p>Done executing task &quot;SqlDeployTask&quot; -- FAILED.</p> <p>Done building target &quot;DspDeploy&quot; in project &quot;DirectBuy.VSR.Main.dbproj&quot; -- FAILED.</p> <p>Done executing task &quot;CallTarget&quot; -- FAILED.</p> <p>Done building target &quot;DBDeploy&quot; in project &quot;DirectBuy.VSR.Main.dbproj&quot; -- FAILED.</p> <p>Done building project &quot;DirectBuy.VSR.Main.dbproj&quot; -- FAILED.</p> </span>Mon, 23 Nov 2009 17:34:00 Z2009-11-24T16:21:05Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/5cf1e5c2-18ed-4b46-b488-16d164270dd3http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/5cf1e5c2-18ed-4b46-b488-16d164270dd3Patrick Mairhttp://social.msdn.microsoft.com/Profile/en-US/?user=Patrick%20MairServer project and multiple databases in one solutionUp until this point, we have been creating a seperate database project for each of our databases in TFS.  So I have a Customer database and a Products database, each with their own solution.  They both reside on the same database server, named PRE01.<br/><br/>I have read in various articles that it's possible to create a server project for PRE01 that holds server level objects for just the server, and further, I should be able to put the server project PRE01 in the same solution as the databases that reside on it, in this case Customer and Products.  So far I don't seem able to do this though - when I create a new project it is one of the other and while I can put references between them, I don't see how to add a server project and database projects to the same solution.<br/><br/>I'm using VSTS:DB 2008.  Am I misunderstanding or can someone give me a quick rundown on how this is done?<br/><br/>Thanks!<br/><br/>PatrickFri, 20 Nov 2009 19:55:11 Z2009-11-23T17:10:55Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/559af7d6-adc0-4038-928b-8518ee85ce54http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/559af7d6-adc0-4038-928b-8518ee85ce54GunderDKhttp://social.msdn.microsoft.com/Profile/en-US/?user=GunderDKBug: "Schema compare does not support the specified data source guid."Hello! <div>I know this place isn't meant for bug reports, but I tried to register on Microsoft Connect, but it hang everytime I tried registering there. (Where do I report a bug on the bug reporting tool?)</div> <div>So in the interest of the community, I decided to post the bug here.</div> <div><br/></div> <div>Last week I had to reinstall my computer, and after installing Visual Studio 2008 Team Suite, VS SP1 and the VSTSDB GDR R2, I loaded the project I'm working on from source control. (TFS) I have SQL Server 2008 Developer Edition installed on my local machine, but I had not added a connection the local DB in the Server Explorer. Then I wanted to do a Schema Compare with my project as the source and the local db as the target. In the dialog where I choose source and target, the source was already set to Project and the target was set to Database. In the drop down list, the item &quot;[RENE-PC.MyDB]&quot; was selected, where RENE-PC is the name of my PC and MyDB is of course the database name. It was already selected, so I did nothing but click &quot;OK&quot;. Then I got a dialogbox saying &quot;Schema compare does not support the specified data source guid.&quot; This was a bit strange, I tried closing Visual Studio, reloading the project, restoring the database etc. Then I tried to do the Schema Compare the other way around, but the Source, Database drop down list was empty. So I pressed &quot;New Connection&quot; and typed &quot;.&quot; for the server, kept &quot;Windows authentication&quot; on and selected the correct database. Then after clicking OK, the New Connection dialog closed, but an error dialog opened saying something like &quot;The data source is not supported&quot;. I couldn't figure out why this was happening, so I tried uninstalling VSTSDB and reinstalling it, and reinstalling VS SP1, but the result was the same. Then I tried to create a connection in the Server Explorer in VS, and then everything worked as it should! When I select the connection as the source or the target, it behaves as expected.<br/> Hope this helps someone.</div>Mon, 27 Apr 2009 10:19:29 Z2009-11-23T14:48:52Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/cd7b98f9-20e1-4612-bfdc-139287b786echttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/cd7b98f9-20e1-4612-bfdc-139287b786ecjasonzxhttp://social.msdn.microsoft.com/Profile/en-US/?user=jasonzxTSD00565 error - isreplicated and cannot be modifiedI just added a bunch of stored procedures to my DB project through Import Scripts. When I am doing a DB comparison, I am getting the error TSD00565 now. I don't think these SPs are replicated. I have also changed the option VerifyDeployment to false. It is still happening.<br/> <br/> What should I do to get rid of these errors?<br/> <br/> Thanks,<br/> -JasonMon, 16 Nov 2009 20:05:12 Z2009-11-24T02:27:33Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/5306f42b-e5d5-4f03-9ef7-ae99d86dbc54http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/5306f42b-e5d5-4f03-9ef7-ae99d86dbc54bccollinhttp://social.msdn.microsoft.com/Profile/en-US/?user=bccollinCan't reference project variables in post deployment script?I have a variable under project properties -&gt; variables <div>It is: Name: FileServer, Value: .\StaticData\dbo.FileServer.staticdata.sql</div> <div><br/></div> <div>In my Script.PostDeployment I have included a line:</div> <div>I have tried both</div> <div>:r $(FileServer)</div> <div>and</div> <div>:r [$(FileServer)</div> <div><br/></div> <div>For the first one, I don't get an error on build but in the deploy script I see:</div> <div> <div>-- The specified file: $(FileServer) could not be found. :r $(FileServer))</div> <div><br/></div> <div>for the second one, I get an error right when I try and build:</div> <div>Error TSD162: Could not find file 'D:\Projects\SQSData_Dev\SQSData_Dev\Scripts\Post-Deployment\[$(FileServer)]'.</div> <div><br/></div> <div>What am I doing wrong... I can't find any help on this anywhere.</div> </div>Fri, 20 Nov 2009 14:40:13 Z2009-11-20T23:32:33Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/8885df33-232e-427b-a295-2cdf31a61266http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/8885df33-232e-427b-a295-2cdf31a61266Antoine Fhttp://social.msdn.microsoft.com/Profile/en-US/?user=Antoine%20FSend content of a file to sqlcmdvarI am trying to put the content of an xml file into a single variable.  I have a script which does it but it takes a long time to execute.<br/><br/>I am therefore trying to achieve it differently.<br/><br/>I have the following which tells how to edit a dbproj to put the content of a file in a project property.<br/><a href="http://timstall.dotnetdevelopersjournal.com/msbuild_read_and_write_from_a_file_to_a_variable.htm">http://timstall.dotnetdevelopersjournal.com/msbuild_read_and_write_from_a_file_to_a_variable.htm</a><br/><br/>I also have this post which tells how to assign a property to a sqlcmdvar<br/><a href="http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/0033e77f-665e-4bda-ba5a-57e34e45c05a">http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/0033e77f-665e-4bda-ba5a-57e34e45c05a</a><br/><br/>Problem is, I have no clue how to put 1 and 1 together.<br/><br/>I am thinking reading into a property and sending to sqlcmdvar.  Sqlcmdvar are accessible by sql scripts and the only exemple I got wrote the content of file to property.  If there is simpler way to do it, like accessing the dbproj property directly in sql scripts or send the content of the file directly to a  sqlcmdvar variable, I'll be glad to hear it.Mon, 16 Nov 2009 16:03:19 Z2009-11-20T20:48:30Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/3468a8e8-e79a-4512-9b92-f13a9bc8790chttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/3468a8e8-e79a-4512-9b92-f13a9bc8790cPatrick Mairhttp://social.msdn.microsoft.com/Profile/en-US/?user=Patrick%20MairRe-using server variables for multiple database referencesWe have been semi-successfully using database references between our projects as we have numerous databases that have views and stored procs that are interconnected between multiple dbs.  It's a data warehouse environment and without getting overly specific, we have a PRE server (7 databases) where source system databases are replicated and then an ETL server (4 databases) where we do our ETL and presentation layers.  Rather than have a mess of interconnected dependencies, on the PRE server there is one database (PREStage) that basically has references to all the other databases AND references to the ETL server too.  The database references on PREStage look like this (using sample DB names):<br/><br/>Referenced Database Schema File          Server Variable Name          Server Variable Value          Database Variable Name          Database Variable Value<br/>a.dbschema                                                                                                                             $(a)                                        a<br/>b.dbschema                                                                                                                             $(b)                                        b<br/>c.dbschema                                          $(ETL)                                 ETL                                    $(c)                                        c<br/>d.dbschema                                          $(ETL1)                               ETL                                    $(d)                                        d<br/><br/>My question relates to the d.dbschema entry.  It is on the same server as c.dbschema, but VSTS won't let me give it the same Server Variable Name - instead it insists on adding a 1 after the &quot;ETL&quot; though it will let me give it any name that is unique.  But it's the same server, so shouldn't I be able to re-use $(ETL)?  As I mentioned above, I have 4 different databases that I want to reference that all live on the ETL server.  So do I have to use ETL, ETL1, ETL2, ETL3 to represent the same server for the 4 different databases I want to reference on it??<br/><br/>I suspect I am missing something related to how these database references actually work.  If you could shed some light on this for me it'd be greatly appreciated.<br/><br/>PatrickThu, 19 Nov 2009 22:25:35 Z2009-11-20T14:19:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/7c2fdcb7-37e9-4967-9635-e5cb6cce9531http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/7c2fdcb7-37e9-4967-9635-e5cb6cce9531T Feldmanhttp://social.msdn.microsoft.com/Profile/en-US/?user=T%20FeldmanSchema Compare generates null resultsIn GDR R2 (Microsoft Visual Studio Team System 2008 Database Edition GDR Version 9.1.40413.00), I have created a db project with tables only.  I want to pull in a few functions and tried to do this via a schema compare with the source database (SQL 2000).  However, the schema compare generates absolutely nothing - doesn't show any objects, equal or otherwise.<br/><br/>Could this possibly have to do with the number of objects involved (there are 575 tables for example)?  When I run a compare between a SQL 2008 db and it's project (different project, different solution), the compare works fine.<br/><br/>Or do I need to build the project before running the schema compare?Thu, 19 Nov 2009 19:51:08 Z2009-11-20T01:18:20Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a707b8be-a26f-4b53-8c31-c5c599cf85f9http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/a707b8be-a26f-4b53-8c31-c5c599cf85f9Orlanzohttp://social.msdn.microsoft.com/Profile/en-US/?user=OrlanzoDeployment Error TSD01268: .Net SqlClient Data Provider: Msg 156, Level 15, State 1, Line 17 Incorrect syntax near the keyword 'FROM'<p>The error is being thrown during deployment because of malformed INSERT INTO statement.  The select list is empty.  This is generated by the deployment engine and I'm unsure of how to correct it outside of manually editing and deploying the *.sql file.</p> <div style="background-color:white;color:black"> <pre><span style="color:blue">CREATE</span> <span style="color:blue">TABLE</span> [dbo].[tmp_ms_xx_Report_Hierarchy] ( [Hierarchy_Id] <span style="color:blue">INT</span> <span style="color:blue">IDENTITY</span> (1, 1) <span style="color:blue">NOT</span> <span style="color:blue">NULL</span>, [Hierarchy_Name] <span style="color:blue">VARCHAR</span> (100) <span style="color:blue">NOT</span> <span style="color:blue">NULL</span>, [Hierarchy_Description] <span style="color:blue">VARCHAR</span> (255) <span style="color:blue">NULL</span> ); <span style="color:blue">ALTER</span> <span style="color:blue">TABLE</span> [dbo].[tmp_ms_xx_Report_Hierarchy] <span style="color:blue">ADD</span> <span style="color:blue">CONSTRAINT</span> [tmp_ms_xx_clusteredindex_PK_Report_Hierarchy] <span style="color:blue">PRIMARY</span> <span style="color:blue">KEY</span> <span style="color:blue">CLUSTERED</span> ([Hierarchy_Id] <span style="color:blue">ASC</span>) <span style="color:blue">WITH</span> (ALLOW_PAGE_LOCKS = <span style="color:blue">ON</span>, ALLOW_ROW_LOCKS = <span style="color:blue">ON</span>, PAD_INDEX = <span style="color:blue">OFF</span>, IGNORE_DUP_KEY = <span style="color:blue">OFF</span>, STATISTICS_NORECOMPUTE = <span style="color:blue">OFF</span>); <span style="color:blue">IF</span> <span style="color:blue">EXISTS</span> (<span style="color:blue">SELECT</span> <span style="color:blue">TOP</span> 1 1 <span style="color:blue">FROM</span> [dbo].[Report_Hierarchy]) <span style="color:blue">BEGIN</span> <span style="color:blue">INSERT</span> <span style="color:blue">INTO</span> [dbo].[tmp_ms_xx_Report_Hierarchy] <span style="color:blue">SELECT</span> <span style="color:blue">FROM</span> [dbo].[Report_Hierarchy]; <span style="color:blue">END</span> <span style="color:blue">DROP</span> <span style="color:blue">TABLE</span> [dbo].[Report_Hierarchy]; <span style="color:blue">EXECUTE</span> sp_rename N<span style="color:#a31515">'[dbo].[tmp_ms_xx_Report_Hierarchy]'</span>, N<span style="color:#a31515">'Report_Hierarchy'</span>; </pre> </div> <hr class=sig> OrlanzoWed, 09 Sep 2009 14:46:48 Z2009-11-19T18:12:05Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b5f022fd-1283-4965-acce-191a5deba3achttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/b5f022fd-1283-4965-acce-191a5deba3acguestMShttp://social.msdn.microsoft.com/Profile/en-US/?user=guestMSVSTSDB 2010: msdb..sysdtspackages table not recongizedHi,<br/><br/>Keeping on evaluating VSTSDB 2010, I found out that sysdtspackages system table is not recognized even after having set a database reference to msdb.schema (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas).<br/><br/>This table is still supported with SQL Server 2008 (as a view), so is this a bug ?<br/><br/>Thanks.<br/><br/><br/>Wed, 18 Nov 2009 16:29:10 Z2009-11-19T17:30:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/95a0264d-f5e4-4721-b097-9f14cd498ff9http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/95a0264d-f5e4-4721-b097-9f14cd498ff9Dave Farmerhttp://social.msdn.microsoft.com/Profile/en-US/?user=Dave%20FarmerDeployment when I have no connection to the target database<span style="font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:#333333;line-height:16px">The environment I am dealing with has a local development server (and each developer has their own SQL Server instance) but QA, Staging and Live are all physically and logically separate so we cannot connect to and deploy to them using VSTS, instead having to provide scripts for the operators to run against the target machines. <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial"><br/></div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">I'm sure many of you are faced with similar architectures, so how can I best make use of the features of Database Pro/GDR, while maintaining a sensible source-controlled environment for the development team which captures changes as easily as possible?</div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial"><br/></div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">Thanks,</div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">Dave.</div> </span>Thu, 19 Nov 2009 16:28:35 Z2009-11-23T04:47:20Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/9e3ae5d3-bbe5-49cf-a4b6-94c0877bc8ddhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/9e3ae5d3-bbe5-49cf-a4b6-94c0877bc8ddRonald Osmohttp://social.msdn.microsoft.com/Profile/en-US/?user=Ronald%20OsmoDSL and VSTSDB integration - Question 1: How do I get my script item to appear in a database project?I have written a Domain Specific Language model that creates a large quantity of database scripts. This works nicely in the expoerimental hive or in a CSharp or VB project but not in a database project. Do VSTSDB projects heavily subclass the VSProject and do their own thing?<br/><br/>Is there a way to make an item template appear within a database project? <br/><br/>This isn't a real showstopper, as one can create a file manually - but it would be so nice :).<br/><br/>Regards<br/>Ron<br/> <pre lang=x-xml>&lt;installerDefinition xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2005/DslTools/InstallerDefinitionModel&quot; productUrl=&quot;http://redox.com&quot; defaultDirectoryName=&quot;DataWarehouseDesigner&quot; productVersion=&quot;1.0.0&quot; requiresCSharp=&quot;false&quot; requiresVisualBasic=&quot;false&quot; productCode=&quot;4cb674c0-cda7-420a-98bc-3e165563e67a&quot; upgradeCode=&quot;282a4f0c-e8fb-403c-9fcb-9b693ef15546&quot; localeId=&quot;1033&quot;&gt; &lt;dslPackage name=&quot;DataWarehouseDesigner&quot; project=&quot;DslPackage&quot; assemblyPath=&quot;Redox.DataWarehouseDesigner.DslPackage.dll&quot; registryRoot=&quot;SOFTWARE\Microsoft\VisualStudio\9.0&quot;&gt; &lt;fileExtensions&gt; &lt;fileExtension name=&quot;redoxdw&quot; extension=&quot;redoxdw&quot; descriptionKey=&quot;FileDescription&quot; hasIcon=&quot;true&quot; iconId=&quot;0&quot;/&gt; &lt;/fileExtensions&gt; &lt;supportingAssemblies&gt; &lt;supportingAssembly name=&quot;Dsl&quot; project=&quot;Dsl&quot; assemblyPath=&quot;Redox.DataWarehouseDesigner.Dsl.dll&quot;/&gt; &lt;/supportingAssemblies&gt; &lt;/dslPackage&gt; &lt;licenseAgreement filePath=&quot;Files\EULA.rtf&quot; isEmbedded=&quot;true&quot; /&gt; &lt;supportingFiles&gt; &lt;supportingFile name=&quot;Readme&quot; filePath=&quot;Files\Readme.htm&quot; installShortcut=&quot;false&quot; shortcutIconPath=&quot;Resources\ReadmeShortcut.ico&quot; openAfterInstall=&quot;true&quot; /&gt; &lt;/supportingFiles&gt; &lt;vsItemTemplates&gt; &lt;vsItemTemplate localeId=&quot;1033&quot; targetDirectories=&quot;CSharp&quot; templatePath=&quot;Files\Data Warehouse helper.zip&quot;/&gt; &lt;vsItemTemplate localeId=&quot;1033&quot; targetDirectories=&quot;VisualBasic&quot; templatePath=&quot;Files\Data Warehouse helper.zip&quot;/&gt; &lt;/vsItemTemplates&gt; &lt;dslSchemas&gt; &lt;dslSchema project=&quot;Dsl&quot; filePath=&quot;GeneratedCode\DataWarehouseDesignerSchema.xsd&quot;/&gt; &lt;/dslSchemas&gt; &lt;/installerDefinition&gt; </pre>Fri, 13 Nov 2009 22:41:53 Z2009-11-20T02:55:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/d1a92b66-711d-4575-8d23-ce23260e3840http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/d1a92b66-711d-4575-8d23-ce23260e3840Ronald Osmohttp://social.msdn.microsoft.com/Profile/en-US/?user=Ronald%20OsmoDSL and VSTSDB integration - Question 2: How should i generate a script item in a database project?I have written a Domain Specific Language model that creates a large quantity of database scripts. This works nicely in the expoerimental hive or in a CSharp or VB project but not in a database project. Do VSTSDB projects heavily subclass the VSProject and do their own thing?<br/><br/>I am using Visual Studio's templating host to create sql script files much as one would do manually in a database project. I create folders and files in the project but when the code adds the file into the project it adds the file in the root of the project. What can I do to fix my code?<br/><br/>You can see the project heirarchy i want to create and i think you can envision the scripting in each folder. The problem happens when the code executes:<br/><br/><strong>                     ContainingProject.ProjectItems.AddFromFile(filePath);<br/></strong><br/>What is a better piece of code in the context of a database project? Must I use the script object model through ISql90Schema or is there a way to do this in a way that leverages the template process I have already created?<br/><br/>Thanks,<br/>Ron<br/><br/> <div style="color:black;background-color:white"> <pre> <br/><span style="font-size:medium"><span style="font-size:medium"><p> </p></span></span><p><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff"> private</span></span><span style="font-size:medium"> </span><span style="font-size:medium;color:#2b91af"><span style="font-size:medium;color:#2b91af">DTE</span></span><span style="font-size:medium"> Dte { </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">get</span></span><span style="font-size:medium">; </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">set</span></span><span style="font-size:medium">; }<span style="font-size:medium"> </span></span><p><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff"> private</span></span><span style="font-size:medium"> </span><span style="font-size:medium;color:#2b91af"><span style="font-size:medium;color:#2b91af">Project</span></span><span style="font-size:medium"> ContainingProject { </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">get</span></span><span style="font-size:medium">; </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">set</span></span><span style="font-size:medium">; }<span style="font-size:medium"> </span></span> <p><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff"> private</span></span><span style="font-size:medium"> </span><span style="font-size:medium;color:#2b91af"><span style="font-size:medium;color:#2b91af">ITextTemplating</span></span><span style="font-size:medium"> TemplatingService { </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">get</span></span><span style="font-size:medium">; </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">set</span></span><span style="font-size:medium">; }<span style="font-size:medium"> </span></span> <p><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff"> private</span></span><span style="font-size:medium"> </span><span style="font-size:medium;color:#2b91af"><span style="font-size:medium;color:#2b91af">ModelingDocData</span></span><span style="font-size:medium"> CurrentDocData { </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">get</span></span><span style="font-size:medium">; </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">set</span></span><span style="font-size:medium">; }</span> <p><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff"> private</span></span><span style="font-size:medium"> </span><span style="font-size:medium;color:#2b91af"><span style="font-size:medium;color:#2b91af">OutputWindowPane</span></span><span style="font-size:medium"> Pane { </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">get</span></span><span style="font-size:medium">; </span><span style="font-size:medium;color:#0000ff"><span style="font-size:medium;color:#0000ff">set</span></span><span style="font-size:medium">; }</span></p>... <span style="color:green">// If the generated code directory doesn't exist then create it</span> SrcTablesDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\Src\Tables&quot;</span>); SrcProcDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\Src\Stored Procedures&quot;</span>); DwTablesDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\DW\Tables&quot;</span>); DwKeysDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\DW\Tables\Keys&quot;</span>); DimViewDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\Dim\Views&quot;</span>); FactViewDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\Fact\Views&quot;</span>); EtlTablesDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\ETL\Tables&quot;</span>); EtlKeysDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\ETL\Tables\Keys&quot;</span>); EtlProcDir = CreateDirectory(ContainingProject.FullName, <span style="color:#a31515">@&quot;Schema Objects\Schemas\ETL\Stored Procedures&quot;</span>); ... <span style="color:blue">private</span> <span style="color:blue">string</span> CreateDirectory(<span style="color:blue">string</span> projectFullName, <span style="color:blue">string</span> subDir) { <span style="color:blue">string</span> codeDir = Path.Combine(Path.GetDirectoryName(projectFullName), subDir); <span style="color:blue">if</span> (!Directory.Exists(codeDir)) Directory.CreateDirectory(codeDir); <span style="color:blue">if</span> (!Directory.Exists(codeDir)) <span style="color:blue">throw</span> <span style="color:blue">new</span> InvalidOperationException(<span style="color:#a31515">&quot;Failed to create output directory: &quot;</span> + codeDir); <span style="color:blue">return</span> codeDir; } <span style="color:blue">private</span> <span style="color:blue">void</span> OutputDefinition(<span style="color:blue">string</span> specificTemplate, <span style="color:blue">string</span> fileDir, <span style="color:blue">string</span> fileName, <span style="color:blue">string</span> fileExtension) { Pane.OutputString(<span style="color:#a31515">&quot;Transforming template creating &quot;</span> + fileName + fileExtension + <span style="color:#a31515">&quot; ... &quot;</span>); <span style="color:blue">string</span> output = TemplatingService.ProcessTemplate(<span style="color:#a31515">&quot;&quot;</span>, specificTemplate, <span style="color:blue">null</span>, <span style="color:blue">null</span>); <span style="color:blue">string</span> filePath = Path.Combine(fileDir, fileName + fileExtension); <span style="color:green"><br/></span> <span style="color:blue">using</span> (StreamWriter writer = <span style="color:blue">new</span> StreamWriter(filePath)) { writer.Write(output); writer.Flush(); } <span style="color:green">// If this is a new file then add it to the project</span> <span style="color:blue">try</span> { <strong>ContainingProject.ProjectItems.AddFromFile(filePath);</strong> } <span style="color:blue">catch</span> <span style="color:green">// Ignore add failures</span> { } <span style="color:blue">if</span> (output.StartsWith(<span style="color:#a31515">&quot;Error&quot;</span>)) Pane.OutputString(<span style="color:#a31515">&quot;failed.\r\n&quot;</span>); <span style="color:blue">else</span> Pane.OutputString(<span style="color:#a31515">&quot;succeeded.\r\n&quot;</span>); } </p></p></p></p></pre> </div>Fri, 13 Nov 2009 23:04:29 Z2009-11-20T02:57:37Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/6b987ee2-4563-4841-8dc8-cba5c8129107http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/6b987ee2-4563-4841-8dc8-cba5c8129107jrl124chttp://social.msdn.microsoft.com/Profile/en-US/?user=jrl124cTSD03006 errorOn GDR, getting TSD03006 errors (which is now an error not a warning, so can't be ignored) for example on following query on AssessorAccountID field. Error says it's ambiguous.  Did not get this error on previous version and view runs fine.<br><br>CREATE VIEW DH_AssessmentsAppealsDetail_0000<br>AS<br>SELECT <br>'0000'                        ReportingYear,<br>ae.CompanyID                CompanyID,<br>ae.StateCode                StateCode,<br>ae.PropertyTypeCode            PropertyTypeCode,<br>ae.AssessorID                AssessorID,<br>f.IsCentrallyAssessed        IsCentrallyAssessed,<br>ae.ParcelID                    ParcelID,<br>p.ParcelNumber                ParcelNumber,<br>p.InactiveDate                ParcelInactiveDate,<br>ae.AssessorAccountID        AssessorAccountID,<br>aa.AssessorAccountNumber    AssessorAccountNumber,<br>aa.InactiveDate                AssessorAccountInactiveDate,<br>COALESCE(tea.EffectiveDate,tes.EffectiveDate)<br>                            AssessmentExpectedDate,<br>COALESCE(trp.EffectiveDate,<br>         traa.EffectiveDate,<br>         tra.EffectiveDate,<br>         trs.EffectiveDate)<br>                            AssessmentReceivedDate,<br><br>fyym1.GroupTotal            FinalYYYYMinus1Value,<br>ryy.GroupTotal                RenderedYYYYValue,<br>ayy.GroupTotal                AssessorsYYYYValue,<br>fyy.GroupTotal                FinalYYYYValue,<br>ap.DueDate                    AppealDueDate,<br>ap.FiledDate                AppealFiledDate,<br>aps.AppealStatusDescription    AppealStatusDescription,<br>0                            TaxAtIssue,<br>0                            TaxSavings,<br>0                            NetSavings,<br>e.EnterpriseID                EnterpriseID,<br>e.EnterpriseName            EnterpriseName,<br>c.CompanyCode                CompanyCode,<br>c.CompanyName                CompanyName,<br>sy.NotesToAssessor            StateYear_NotesToAssessor,<br>sy.OtherNotes                StateYear_OtherNotes,<br>a.Title                        Assessor_Title,<br>a.Notes                        Assessor_Notes,<br>a.NotesToAssessor            Assessor_NotesToAssessor<br><br>FROM (SELECT <br>      CompanyID, <br>      StateCode, <br>      PropertyTypeCode, <br>      AssessorID, <br>      ParcelID, <br>      AssessorAccountID, <br>      MAX(FilingAccountID)  FilingAccountID, <br>      SUM(GroupTotal)        GroupTotal<br>      FROM [$(PROP_YYYY)].dbo.AssessmentsExpected_Count     WITH (NOEXPAND)   <br>      GROUP BY CompanyID,StateCode,PropertyTypeCode,AssessorID,ParcelID,AssessorAccountID<br>      ) ae<br>LEFT JOIN FilingAccount f ON f.FilingAccountID = ae.FilingAccountID<br>LEFT JOIN AssessorAccount aa ON aa.AssessorAccountID = ae.AssessorAccountID AND ae.ParcelID = 0<br>LEFT JOIN Parcel p ON p.ParcelID = ae.ParcelID AND ae.ParcelID &lt;&gt; 0<br><br>LEFT JOIN CalendarEvent tea<br>       ON tea.CalendarEventTypeID = 7<br>      AND tea.ReportingYear = 0000<br>      AND tea.StateCode = ae.StateCode<br>      AND tea.CompanyID = ae.CompanyID<br>      AND tea.PropertyTypeCode = ae.PropertyTypeCode<br>      AND tea.JurisdictionType = 2 AND tea.AssessorID = ae.AssessorID<br><br>LEFT JOIN CalendarEvent tes<br>       ON tes.CalendarEventTypeID = 7<br>      AND tes.ReportingYear = 0000<br>      AND tes.StateCode = ae.StateCode<br>      AND tes.CompanyID = ae.CompanyID<br>      AND tes.PropertyTypeCode = ae.PropertyTypeCode<br>      AND tes.JurisdictionType = 1<br><br>LEFT JOIN CalendarEvent traa<br>       ON traa.CalendarEventTypeID = 8<br>      AND traa.ReportingYear = 0000<br>      AND traa.StateCode = ae.StateCode<br>      AND traa.CompanyID = ae.CompanyID<br>      AND traa.PropertyTypeCode = ae.PropertyTypeCode<br>      AND traa.JurisdictionType = 2 AND traa.AssessorAccountID = ae.AssessorAccountID<br>      AND ae.ParcelID = 0<br><br>LEFT JOIN CalendarEvent trp<br>       ON trp.CalendarEventTypeID = 8<br>      AND trp.ReportingYear = 0000<br>      AND trp.StateCode = ae.StateCode<br>      AND trp.CompanyID = ae.CompanyID<br>      AND trp.PropertyTypeCode = ae.PropertyTypeCode<br>      AND trp.JurisdictionType = 6 AND trp.ParcelID = ae.ParcelID<br>      AND ae.ParcelID &lt;&gt; 0<br><br>LEFT JOIN CalendarEvent tra<br>       ON tra.CalendarEventTypeID = 8<br>      AND tra.ReportingYear = 0000<br>      AND tra.StateCode = ae.StateCode<br>      AND tra.CompanyID = ae.CompanyID<br>      AND tra.PropertyTypeCode = ae.PropertyTypeCode<br>      AND tra.JurisdictionType = 2 AND tra.AssessorID = ae.AssessorID<br><br>LEFT JOIN CalendarEvent trs<br>       ON trs.CalendarEventTypeID = 8<br>      AND trs.ReportingYear = 0000<br>      AND trs.StateCode = ae.StateCode<br>      AND trs.CompanyID = ae.CompanyID<br>      AND trs.PropertyTypeCode = ae.PropertyTypeCode<br>      AND trs.JurisdictionType = 1<br><br>LEFT JOIN (SELECT CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID, SUM(GroupTotal) GroupTotal <br>           FROM DH_Final_Value<br>           WHERE ReportingYear = 0000 - 1<br>           GROUP BY CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID<br>           ) fyym1<br>           ON fyym1.CompanyID = ae.CompanyID<br>          AND fyym1.StateCode = ae.StateCode<br>          AND fyym1.AssessorID = ae.AssessorID<br>          AND fyym1.AssessorAccountID = ae.AssessorAccountID<br>          AND fyym1.ParcelID = ae.ParcelID<br><br>LEFT JOIN (SELECT CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID, SUM(GroupTotal) GroupTotal <br>           FROM DH_AssessmentsRendered_Value<br>           WHERE ReportingYear = 0000<br>           GROUP BY CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID<br>           ) ryy<br>           ON ryy.CompanyID = ae.CompanyID<br>          AND ryy.StateCode = ae.StateCode<br>          AND ryy.AssessorID = ae.AssessorID<br>          AND ryy.AssessorAccountID = ae.AssessorAccountID<br>          AND ryy.ParcelID = ae.ParcelID<br><br>LEFT JOIN (SELECT CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID, SUM(GroupTotal) GroupTotal <br>           FROM DH_Assessors_Value<br>           WHERE ReportingYear = 0000<br>           GROUP BY CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID<br>           ) ayy<br>           ON ayy.CompanyID = ae.CompanyID<br>          AND ayy.StateCode = ae.StateCode<br>          AND ayy.AssessorID = ae.AssessorID<br>          AND ayy.AssessorAccountID = ae.AssessorAccountID<br>          AND ayy.ParcelID = ae.ParcelID<br><br>LEFT JOIN (SELECT CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID, SUM(GroupTotal) GroupTotal <br>           FROM DH_Final_Value<br>           WHERE ReportingYear = 0000<br>           GROUP BY CompanyID,StateCode,AssessorID,AssessorAccountID,ParcelID<br>           ) fyy<br>           ON fyy.CompanyID = ae.CompanyID<br>          AND fyy.StateCode = ae.StateCode<br>          AND fyy.AssessorID = ae.AssessorID<br>          AND fyy.AssessorAccountID = ae.AssessorAccountID<br>          AND fyy.ParcelID = ae.ParcelID<br><br>LEFT JOIN Appeal ap<br>       ON ap.ReportingYear = 0000<br>      AND ap.CompanyID = ae.CompanyID<br>      AND ((ap.ParcelID = ae.ParcelID AND ap.ParcelID &gt; 0)<br>           OR (ap.AssessorAccountID = ae.AssessorAccountID AND ap.AssessorAccountID &gt; 0))<br><br>LEFT JOIN AppealStatus aps<br>       ON aps.AppealStatusID = (SELECT TOP 1 AppealStatusID<br>                                    FROM AppealDetail apd<br>                                   WHERE apd.AppealID = ap.AppealID<br>                                ORDER BY apd.AppealDetailID DESC)<br>                                <br>LEFT JOIN Company c ON c.CompanyID = ae.CompanyID<br>LEFT JOIN Enterprise e ON e.EnterpriseID = c.EnterpriseID<br>LEFT JOIN StateYear sy ON sy.StateCode = ae.StateCode AND sy.ReportingYear = 0000<br>LEFT JOIN Assessor a ON a.AssessorID = ae.AssessorID<br><br><br><br>            <br>Thu, 08 Jan 2009 18:59:19 Z2009-11-20T15:54:19Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/4c9ab11b-9ca2-4fd1-ade3-6e6fecae73a7http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/4c9ab11b-9ca2-4fd1-ade3-6e6fecae73a7RobAshton_UKhttp://social.msdn.microsoft.com/Profile/en-US/?user=RobAshton_UKPossible bug in pre- and post-deployment scripting?Hi folks, I came a cross a problem recently with our post-deployment scripting and was wondering if anyone else had encountered it or even if it was a known bug in VSDB? <div><br/></div> <div>I'm writing our post-deployment scripts such that we insert our static data for certain tables into temp tables, then insert each line if it doesn't exist, like so:</div> <div><br/></div> <div> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">DECLARE</span> @RowVariable <span style="color:Blue">int</span>; <span style="color:Blue">DECLARE</span> @MaxRowVariable <span style="color:Blue">int</span>; <span style="color:Blue">CREATE</span> <span style="color:Blue">TABLE</span> #TempTable( RowNumber <span style="color:Blue">int</span> <span style="color:Blue">NOT</span> <span style="color:Blue">NULL</span>, PK_Value <span style="color:Blue">int</span> <span style="color:Blue">NOT</span> <span style="color:Blue">NULL</span>, Identifier <span style="color:Blue">nvarchar</span>(75) <span style="color:Blue">NOT</span> <span style="color:Blue">NULL</span>, Text_Value <span style="color:Blue">nvarchar</span>(2000) <span style="color:Blue">NOT</span> <span style="color:Blue">NULL</span> ); <span style="color:Blue">WITH</span> TableContent ( PK_Value, Identifier, Text_Value ) <span style="color:Blue">AS</span>( <span style="color:Blue">SELECT</span> 1, N<span style="color:#A31515">'Identifier_1'</span>, N<span style="color:#A31515">'I am some text'</span> <span style="color:Blue">UNION</span> <span style="color:Blue">ALL</span> <span style="color:Blue">SELECT</span> 2, N<span style="color:#A31515">'Identifier_2'</span>, N<span style="color:#A31515">'I am some more text'</span> ) <span style="color:Blue">INSERT</span> <span style="color:Blue">INTO</span> #TempTable <span style="color:Blue">SELECT</span> <span style="color:Magenta">ROW_NUMBER</span>() <span style="color:Blue">OVER</span>(<span style="color:Blue">ORDER</span> <span style="color:Blue">BY</span> PK_Value) PK_Value, Identifier, Text_Value <span style="color:Blue">FROM</span> TableContent; <span style="color:Blue">SET</span> @RowVariable = 1; <span style="color:Blue">SET</span> @MaxRowVariable = (<span style="color:Blue">SELECT</span> <span style="color:Magenta">MAX</span>(RowNumber) <span style="color:Blue">FROM</span> #TempTable); <span style="color:Blue">WHILE</span> @RowVariable &lt;=@MaxRowVariable <span style="color:Blue">BEGIN</span> <span style="color:Blue">IF</span> <span style="color:Blue">NOT</span> <span style="color:Blue">EXISTS</span>( <span style="color:Blue">SELECT</span> [Row].RowNumber <span style="color:Blue">FROM</span> dbo.RealTable <span style="color:Blue">CROSS</span> APPLY( <span style="color:Blue">SELECT</span> RowNumber <span style="color:Blue">FROM</span> #TempTable <span style="color:Blue">WHERE</span> #TempTable.RowNumber = @RowVariable <span style="color:Blue">AND</span> #TempTable.PK_Value = dbo.RealTable.PK_Value) <span style="color:Blue">AS</span> [Row]) <span style="color:Blue">BEGIN</span>; <span style="color:Blue">INSERT</span> <span style="color:Blue">INTO</span> dbo.RealTable ( PK_Value, Identifier, Text_Value) <span style="color:Blue">SELECT</span> PK_Value, Identifier, Text_Value <span style="color:Blue">FROM</span> #TempTable <span style="color:Blue">WHERE</span> RowNumber = @RowVariable; <span style="color:Blue">END</span>; <span style="color:Blue">SET</span> @RowVariable = @RowVariable + 1; <span style="color:Blue">END</span>; <span style="color:Blue">DROP</span> <span style="color:Blue">TABLE</span> #TempTable; </pre> </div> <div><br/></div> However I came across another &quot;Fatal Parser Error&quot; when one of the Text_Values contained a string like &quot;The following characters are not permitted in this field: a-z A-Z 0-9 !£$()[]{};'@~,.`¬&quot;.</div> <div><br/></div> <div>It appears that the substring &quot;$()&quot; is being interpreted as a SQLCMD variable, even though it is being declared as a nvarchar string like so:</div> <div>N'The following characters are not permitted in this field: a-z A-Z 0-9 !£$()[]{};''@~,.`¬'</div> <div><br/></div> <div>I worked around it by splitting the $ and ( like so:</div> <div>N'The following characters are permitted in this field: a-z A-Z 0-9 !£$' + N'()[]{};''@~,.`¬'</div> <div><br/></div> <div>But surely the SQLCMD parsing should be bright enough to ignore the $() stuff if it's been placed inside a string? The Visual Studio UI changes the string's colour-coding to reflect that it is a string, so why doesn't the parser understand the difference??</div> <div><br/></div> <div>Thanks, Rob</div>Wed, 04 Nov 2009 15:57:34 Z2009-11-19T04:41:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/77886d36-fa2a-4190-85a4-d9a2311f565fhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/77886d36-fa2a-4190-85a4-d9a2311f565fLeon Maynehttp://social.msdn.microsoft.com/Profile/en-US/?user=Leon%20MayneUpdating a stored procedure<p>I think I must be doing something stupid here. I have a stored procedure defined that already exists in my test database. I make a quick change to the procedure in Visual Studio and then I want to test it on my test environment. I therefore right-click the code and select 'Execute SQL', but am told the procedure already exists. If I add some code before the CREATE PROCEDURE line to check if the procedure exist and delete it then I get parse errors popping up in the IDE. I can't change the CREATE to a MODIFY as this causes parse errors.</p> <p><font face=Verdana>I don't see an option to 'overwrite' stored procedures when executing them, and I don't want to have to use the Compare Schema option to create a full release script whenever I make a small procedure change, and selecting the procedure in the server exporer and deleting it each time is just annoying.</font></p> <p><font face=Verdana>How can I add some code or similar to drop the procedure when I want to run my script?</font></p>Mon, 16 Oct 2006 14:47:07 Z2009-11-18T22:24:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/429d7d5e-03c3-4afc-819a-1beaa51bb5e8http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/429d7d5e-03c3-4afc-819a-1beaa51bb5e8actbilbohttp://social.msdn.microsoft.com/Profile/en-US/?user=actbilboCannot invoke Regular Expression Builder for Data GenerationRunning VSTS 2008 Database Edition GDR 2.  I have also downloaded and installed the Power Tools.  <br/><br/>I have a Database Project that I'm trying to launch and use the RegEx Builder - in a Data Generation Plan I choose a column on a table, set the Generator to &quot;Regular Expression&quot;.  I cannot invoke the Builder (from Power Tools) either by:<br/>a) there is no &quot;...&quot; browse button in the column to the right of Generator Output<br/>b) the Data&gt;Data Generator&gt;Regular Expression Builder menu option does nothing<br/><br/>Lastly, how do I know if I really have the Power Tools (correctly) installed?Wed, 11 Nov 2009 22:09:10 Z2009-11-18T09:26:09Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/06927567-2f61-45b8-9fd6-aa9ee9451550http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/06927567-2f61-45b8-9fd6-aa9ee9451550nooniehttp://social.msdn.microsoft.com/Profile/en-US/?user=noonieGDR CTP 17 - Error - The model already has an element that has the same name AutoCreatedLocal.<p align=left>Greetings,</p> <p align=left> </p> <p align=left>When creating a database reference to Master in a project that was created from importing the schema of an existing database I get the following error:-</p> <p align=left> </p> <p align=left><strong>Error 16 The model already has an element that has the same name AutoCreatedLocal.</strong></p> <p align=left> </p> <p align=left>Although I can easily delete the Route definintion from my project to make the error go away I can't help wondering if this is the correct behaviour and whether the route difinintions should really be in the master.dbschema file?</p> <p align=left> </p> <p align=left>-- </p> <p align=left>Regards,</p> <p align=left>Neale NOON</p> <p align=left> </p>Tue, 07 Oct 2008 05:42:37 Z2009-11-17T23:24:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/240b0ad1-7ea6-4e04-a9f6-d527a7f76f68http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/240b0ad1-7ea6-4e04-a9f6-d527a7f76f68bsstricklandhttp://social.msdn.microsoft.com/Profile/en-US/?user=bsstricklandRefactor Error: Failed to Check out files error when trying to rename via Refactor commandGetting an error (no error number) when using the Refactor command to rename an object. Funny thing is, it was working this morning.  My computer shut down unexpectedly and since then I have not been able to do a rename refactor because of this error.<br/><br/>STR:<br/>1.  Go to Schema View and right click object to change<br/>2.  Select Refactor &gt; Rename<br/>3. Edit name and select all 4 options (preview, assume default schema, update references, generate refactoring log)<br/>4. click OK<br/>5. In the Preview Window, select Apply<br/>6.  Error appears --&gt; Refactor Error     Failed to check out files.<br/><br/>I can individually check out each of the items that are going to be changed for the rename. The error only occurs when doing a Refactor Rename.  Tried doing this with no options (per step 3 above) and it still happens.<br/><br/>Did a google and forum search and there is no instance of this particular Refactoring Error.<br/><br/>Don't know where to go from here...Mon, 16 Nov 2009 22:11:17 Z2009-11-24T04:42:03Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/959f9460-a23b-4264-b6d0-17436db4d1c7http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/959f9460-a23b-4264-b6d0-17436db4d1c7Leon Maynehttp://social.msdn.microsoft.com/Profile/en-US/?user=Leon%20MayneStill a bit slow opening projects<p>Hello,<br>As mentioned before, the import schema process is extremely fast now, which was pleasantly surprising, however opening an existing project with lots (&gt;5,000) of objects still takes a long time. This is also without using source control and so I'm guessing it would take up to 10 minutes to open if I put my project into TFS / VSS.</p> <p>Is there any way to speed up the opening process, e.g. by disabling particular schema checks when first opening the project?</p>Thu, 23 Nov 2006 09:36:58 Z2009-11-22T16:18:40Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/ba4f3898-4b54-4fd5-8dc6-b203e60f086ahttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/ba4f3898-4b54-4fd5-8dc6-b203e60f086absstricklandhttp://social.msdn.microsoft.com/Profile/en-US/?user=bsstricklandDatabase deployment for beginnersI am trying to get my head around deployment configurations. We are planning to have each ASP.NET developer have a local copy of the db for development. The biggest problem is that we have our production versions in source control, and the users are different in prod than on the local databases. I have been trying to find a tutorial or overview for how to accomplish this, but my long running search has so far been somewhat vain. <br/><br/>Does anyone have suggestions on reading material for this particular subject?Tue, 17 Nov 2009 01:03:14 Z2009-11-25T03:56:38Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/f238f00e-b4a8-4e61-bce6-58053f4d6386http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/f238f00e-b4a8-4e61-bce6-58053f4d6386Barclay Hillhttp://social.msdn.microsoft.com/Profile/en-US/?user=Barclay%20HillMicrosoft Visual Studio Team System 2008 Database Edition GDR R2 (Available)<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN>The RTM version of <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed">Microsoft Visual Studio Team System 2008 Database Edition GDR R2</a> is now available for customers to download.  The GDR R2 version is the most current release of Database Edition that adds support for SQL Server 2008 and numerous new features. See the<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed"> GDR R2 download page</a> for more details. The GDR R2 is available to all customers through the same Microsoft Download channel customers acquired the GDR from. The previous version of the GDR is no longer available.</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"> </p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN>We appreciate customers who participated in service release candidate evaluation program and confirmed fixes in that limited release. </span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN><strong>Version Upgrade</strong> </span></p> <ul> <li> <div class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN>Customers currently using the [9.1.31124.01] version of GDR should upgrade to GDR R2 version [9.1.40413.00] to get the latest set of fixes available for the product. </span></div> </li> <li> <div class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN>Customers currently using Microsoft Visual Studio Team System 2008 Database Edition [9.0.30729.1 SP] should upgrade to GDR R2. It is not necessary to install the GDR prior to installing GDR R2. A project upgrade for projects previously created with the GDR is required when upgrading to GDR R2, but the upgraded project will stay compatible with the GDR. A project upgrade for projects previously created with the Microsoft Visual Studio Team System 2008 Database Edition [9.0.30729.1 SP] is required when upgrading to GDR R2 resulting in upgraded projects that are only compatible with GDR and GDR R2.</span></div> </li> <li> <div class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana','sans-serif';font-size:10pt" lang=EN>Customers who have installed the Visual Studio 2008 Database Edition GDR v2 RC1 will need to <span style="text-decoration:underline">uninstall</span> the GDR RC version [9.1.40320.00] to successfully install the GDR R2. No project upgrade will be necessary for these customers.<br/><br/>Read more about this release here: <a href="http://blogs.msdn.com/vstsdb/archive/2009/04/21/microsoft-visual-studio-team-system-2008-database-edition-gdr-r2.aspx">Microsoft Visual Studio Team System 2008 Database Edition GDR R2</a> </span></div> </li> </ul> <hr class=sig> Barclay Hill Program Manager VSTS: DB Team (DataDude, DBPro, Database Edition) Please mark the responses as answer if it resolves your question.Wed, 22 Apr 2009 17:45:28 Z2009-11-17T11:54:30Z