Refactoring not working when deployingHi All,<br/> <br/> I am having the same issue as in this thread.<br/> http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/c68362df-ed28-4942-9531-d3ddfc5c769a?prof=required<br/> <br/> I renamed a table in my schema through the refactoring interface. A refactorlog is created.<br/> <br/> But when I deploy nothing is renamed. All that happens is an additional table is added without any data.<br/> <br/> I have searched the documentation about refactoring but I can't find any documentation that clearly teaches me what steps to take to have the deploy process create the changes for me in such a manner that they are only applied if not done so already by keeping track of the refactorguids in the __RefactorLog table.<br/> <br/> Me and my team consider this one of the last hurdles to take before we can confidently start adopting db projects through out our organisation.<br/> <br/> Regards,<br/> <br/> Ed Tijgen© 2009 Microsoft Corporation. All rights reserved.Wed, 22 Jul 2009 18:14:57 Z53207164-87fa-4bc8-a94e-d9f660a8aeebhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#53207164-87fa-4bc8-a94e-d9f660a8aeebhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#53207164-87fa-4bc8-a94e-d9f660a8aeebEd Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingHi All,<br/> <br/> I am having the same issue as in this thread.<br/> http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/c68362df-ed28-4942-9531-d3ddfc5c769a?prof=required<br/> <br/> I renamed a table in my schema through the refactoring interface. A refactorlog is created.<br/> <br/> But when I deploy nothing is renamed. All that happens is an additional table is added without any data.<br/> <br/> I have searched the documentation about refactoring but I can't find any documentation that clearly teaches me what steps to take to have the deploy process create the changes for me in such a manner that they are only applied if not done so already by keeping track of the refactorguids in the __RefactorLog table.<br/> <br/> Me and my team consider this one of the last hurdles to take before we can confidently start adopting db projects through out our organisation.<br/> <br/> Regards,<br/> <br/> Ed TijgenFri, 26 Jun 2009 15:29:54 Z2009-06-26T15:29:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#546161bc-8abd-4b5a-b2f6-f47a0322542dhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#546161bc-8abd-4b5a-b2f6-f47a0322542dGert Drapershttp://social.msdn.microsoft.com/Profile/en-US/?user=Gert%20DrapersRefactoring not working when deployingJust checking, but your are deploying, using deploy, not using schema compare, correct?<br/>Which schema is the __RefactoringLog table created in?<br/>Can you post the content of the &lt;projectname&gt;.refactorlog file.<br/><hr class="sig">GertD @ www.DBProj.com Fri, 26 Jun 2009 22:14:07 Z2009-06-26T22:14:07Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#2323da32-3e8a-4bbf-8317-59386d696697http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#2323da32-3e8a-4bbf-8317-59386d696697Gokhan Caglarhttp://social.msdn.microsoft.com/Profile/en-US/?user=Gokhan%20CaglarRefactoring not working when deployingHi Ed, are you using the R2 version(9.1.40413.00), there has been some fixes in this area.  Also when you say deploy, you don't mean write updates in Schema Compare, right?  This only works for deploy that's in the build menu.Fri, 26 Jun 2009 22:47:12 Z2009-06-26T22:47:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#289d660a-9e8e-4324-92bf-157569d40790http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#289d660a-9e8e-4324-92bf-157569d40790Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingYEs Gert, I am deploying (not using schema compare)<br/> <br/> The __RefactoringLog table is not created at all, I mentioned that table because I read somewhere that is supposed to happen.<br/> <br/> THe contents of the refactorlog is as follows:<br/> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/> &lt;Operations&gt;<br/>   &lt;Operation Name=&quot;Rename Refactor&quot; Key=&quot;7a737e46-bb55-461b-bad2-30181a2f9ee1&quot; ChangeDateTime=&quot;06/26/2009 14:41:11&quot;&gt;<br/>     &lt;Property Name=&quot;ElementName&quot; Value=&quot;[dbo].[Table_1]&quot; /&gt;<br/>     &lt;Property Name=&quot;ElementType&quot; Value=&quot;ISql100Table&quot; /&gt;<br/>     &lt;Property Name=&quot;ParentElementName&quot; Value=&quot;[dbo]&quot; /&gt;<br/>     &lt;Property Name=&quot;ParentElementType&quot; Value=&quot;ISql90Schema&quot; /&gt;<br/>     &lt;Property Name=&quot;NewName&quot; Value=&quot;[Table_11]&quot; /&gt;<br/>   &lt;/Operation&gt;<br/> &lt;/Operations&gt;<br/> <br/>Sat, 27 Jun 2009 04:57:46 Z2009-06-27T04:57:46Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#e41adedc-7fc1-4f5f-b877-127a208d6930http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#e41adedc-7fc1-4f5f-b877-127a208d6930Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingI realized I was still using an older version of the GDR so I downloaded and installed the R2 just now. The installer interface told me that the GDR was about to be updated. <br/> <br/> But still no luck, and indeed I am using the deploy process ( not the schema compare ) I tried both right clicking the project in solution explorer and deploying from there and I tried deploying from the build menu. Both are yielding no luck.<br/> <br/> Regards,<br/> <br/> Ed Tijgen<br/>Sat, 27 Jun 2009 04:59:56 Z2009-06-27T04:59:56Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f95ccedd-92af-44d5-927b-40bdeeaabca3http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f95ccedd-92af-44d5-927b-40bdeeaabca3JoyceWang_MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=JoyceWang_MSFTRefactoring not working when deployingHi Ed,<br/><br/>When you deploy, did you see any warning or error output? Could you share the deploy script under .\sql\debug\? In the deployment script, did you see the part to create Refactorlog table on your target database? <br/><br/>Thanks,<br/>JoyceMon, 29 Jun 2009 16:14:06 Z2009-06-29T16:14:06Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#6752b41c-f411-4fec-8d7a-e1c6f6223ea5http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#6752b41c-f411-4fec-8d7a-e1c6f6223ea5Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingHello Joyce,<br/> <br/> The deploy output text shows no errors. Here is it:<br/> ------ Build started: Project: VSRefactoring, Configuration: Debug Any CPU ------<br/>   VSRefactoring -&gt; C:\_data\Projects\Testing\dbprojects\VSRefactoring\VSRefactoring\sql\debug\VSRefactoring.dbschema<br/> ------ Deploy started: Project: VSRefactoring, Configuration: Debug Any CPU ------<br/>     Deployment script generated to:<br/> C:\_data\Projects\Testing\dbprojects\VSRefactoring\VSRefactoring\sql\debug\VSRefactoring.sql<br/> <br/> ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========<br/> ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========<br/> <br/> <br/> And there is no mention of the REfactorLog table in the deployment script. Here is it:<br/> <br/> /*<br/> Deployment script for SourceDB<br/> */<br/> <br/> GO<br/> SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;<br/> <br/> SET NUMERIC_ROUNDABORT OFF;<br/> <br/> <br/> GO<br/> :setvar DatabaseName &quot;SourceDB&quot;<br/> :setvar DefaultDataPath &quot;E:\_data\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\&quot;<br/> <br/> GO<br/> USE [master]<br/> <br/> GO<br/> :on error exit<br/> GO<br/> IF (DB_ID(N'$(DatabaseName)') IS NOT NULL<br/>     AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') &lt;&gt; N'ONLINE')<br/> BEGIN<br/>     RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF NOT EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)')<br/> BEGIN<br/>     RAISERROR(N'You cannot deploy this update script to target DIVERSITYMOBILE. The database for which this script was built, SourceDB, does not exist on this server.', 16, 127) WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF (@@servername != 'DIVERSITYMOBILE')<br/> BEGIN<br/>     RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'DIVERSITYMOBILE',@@servername) WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF CAST(DATABASEPROPERTY(N'$(DatabaseName)','IsReadOnly') as bit) = 1<br/> BEGIN<br/>     RAISERROR(N'You cannot deploy this update script because the database for which it was built, %s , is set to READ_ONLY.', 16, 127, N'$(DatabaseName)') WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> USE [$(DatabaseName)]<br/> <br/> GO<br/> <br/> GO<br/> /*<br/>  Pre-Deployment Script Template                            <br/> --------------------------------------------------------------------------------------<br/>  This file contains SQL statements that will be executed before the build script.    <br/>  Use SQLCMD syntax to include a file in the pre-deployment script.            <br/>  Example:      :r .\myfile.sql                                <br/>  Use SQLCMD syntax to reference a variable in the pre-deployment script.        <br/>  Example:      :setvar TableName MyTable                            <br/>                SELECT * FROM [$(TableName)]                    <br/> --------------------------------------------------------------------------------------<br/> */<br/> <br/> GO<br/> <br/> GO<br/> <br/> GO<br/> /*<br/> Post-Deployment Script Template                            <br/> --------------------------------------------------------------------------------------<br/>  This file contains SQL statements that will be appended to the build script.        <br/>  Use SQLCMD syntax to include a file in the post-deployment script.            <br/>  Example:      :r .\myfile.sql                                <br/>  Use SQLCMD syntax to reference a variable in the post-deployment script.        <br/>  Example:      :setvar TableName MyTable                            <br/>                SELECT * FROM [$(TableName)]                    <br/> --------------------------------------------------------------------------------------<br/> */<br/> <br/> GO<br/> -- Refactoring step to update target server with deployed transaction logs<br/> <br/> GO<br/> <br/> GO<br/> <br/> <br/> <br/> I am getting a bit nervous now.<br/> <br/> Regards,<br/> <br/> Ed TijgenTue, 30 Jun 2009 08:04:50 Z2009-06-30T08:04:50Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#595db0b5-64ba-4851-80d7-da4e96f37b2ahttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#595db0b5-64ba-4851-80d7-da4e96f37b2aJoyceWang_MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=JoyceWang_MSFTRefactoring not working when deployingHi Ed,<br/><br/>According the deployment script you have here, essentially nothing is created or dropped in this deployment.  This means, your database project has the same schema with the target database you are deploying to. Have you tried to compare your database project with the target database? Did you see any difference on the tables in the schema comparison designer?<br/><br/>After refactoring, did you deploy to the same target database? You said nothing is renamed but an additional table. So do you see both Table_1 and Table_11 in your target database?<br/><br/>Thanks,<br/>Joyce<br/>Tue, 30 Jun 2009 16:14:23 Z2009-06-30T16:14:23Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#77ec66c7-4e45-4393-868b-d52985fd1427http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#77ec66c7-4e45-4393-868b-d52985fd1427Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingHi Joyce,<br/> <br/> Indeed the db schema was similar to the db project schema.<br/> <br/> I have removed table_11 now in the hope that when I deploy table_1 gets renamed to table_11. But what happens is that a table &quot;table_11&quot; is added.<br/> <br/> Again no error in the deplay output:<br/> ------ Build started: Project: VSRefactoring, Configuration: Debug Any CPU ------<br/>   VSRefactoring -&gt; C:\_data\Projects\Testing\dbprojects\VSRefactoring\VSRefactoring\sql\debug\VSRefactoring.dbschema<br/> ------ Deploy started: Project: VSRefactoring, Configuration: Debug Any CPU ------<br/>     Deployment script generated to:<br/> C:\_data\Projects\Testing\dbprojects\VSRefactoring\VSRefactoring\sql\debug\VSRefactoring.sql<br/> <br/>     Creating dbo.Table_11...<br/> ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========<br/> ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========<br/> <br/> Please review the new sql script:<br/> /*<br/> Deployment script for SourceDB<br/> */<br/> <br/> GO<br/> SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;<br/> <br/> SET NUMERIC_ROUNDABORT OFF;<br/> <br/> <br/> GO<br/> :setvar DatabaseName &quot;SourceDB&quot;<br/> :setvar DefaultDataPath &quot;E:\_data\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\&quot;<br/> <br/> GO<br/> USE [master]<br/> <br/> GO<br/> :on error exit<br/> GO<br/> IF (DB_ID(N'$(DatabaseName)') IS NOT NULL<br/>     AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') &lt;&gt; N'ONLINE')<br/> BEGIN<br/>     RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF NOT EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)')<br/> BEGIN<br/>     RAISERROR(N'You cannot deploy this update script to target DIVERSITYMOBILE. The database for which this script was built, SourceDB, does not exist on this server.', 16, 127) WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF (@@servername != 'DIVERSITYMOBILE')<br/> BEGIN<br/>     RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'DIVERSITYMOBILE',@@servername) WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> <br/> IF CAST(DATABASEPROPERTY(N'$(DatabaseName)','IsReadOnly') as bit) = 1<br/> BEGIN<br/>     RAISERROR(N'You cannot deploy this update script because the database for which it was built, %s , is set to READ_ONLY.', 16, 127, N'$(DatabaseName)') WITH NOWAIT<br/>     RETURN<br/> END<br/> <br/> GO<br/> USE [$(DatabaseName)]<br/> <br/> GO<br/> <br/> GO<br/> /*<br/>  Pre-Deployment Script Template                            <br/> --------------------------------------------------------------------------------------<br/>  This file contains SQL statements that will be executed before the build script.    <br/>  Use SQLCMD syntax to include a file in the pre-deployment script.            <br/>  Example:      :r .\myfile.sql                                <br/>  Use SQLCMD syntax to reference a variable in the pre-deployment script.        <br/>  Example:      :setvar TableName MyTable                            <br/>                SELECT * FROM [$(TableName)]                    <br/> --------------------------------------------------------------------------------------<br/> */<br/> <br/> GO<br/> <br/> GO<br/> PRINT N'Creating dbo.Table_11...';<br/> <br/> <br/> GO<br/> CREATE TABLE [dbo].[Table_11] (<br/>     [FieldA] NCHAR (10) NULL<br/> );<br/> <br/> <br/> GO<br/> <br/> GO<br/> /*<br/> Post-Deployment Script Template                            <br/> --------------------------------------------------------------------------------------<br/>  This file contains SQL statements that will be appended to the build script.        <br/>  Use SQLCMD syntax to include a file in the post-deployment script.            <br/>  Example:      :r .\myfile.sql                                <br/>  Use SQLCMD syntax to reference a variable in the post-deployment script.        <br/>  Example:      :setvar TableName MyTable                            <br/>                SELECT * FROM [$(TableName)]                    <br/> --------------------------------------------------------------------------------------<br/> */<br/> <br/> GO<br/> -- Refactoring step to update target server with deployed transaction logs<br/> <br/> GO<br/> <br/> GO<br/> <br/> <br/> Again no refactoring is taking place :-(<br/> <br/> Is there hope for me and my team?<br/> <br/> Regards,<br/> <br/> Ed Tijgen<br/> <br/>Tue, 30 Jun 2009 16:28:27 Z2009-06-30T16:28:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#2161a1df-c506-4adb-abc1-7a5c8224c8c1http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#2161a1df-c506-4adb-abc1-7a5c8224c8c1Jamie Laflen MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Jamie%20Laflen%20MSFTRefactoring not working when deploying<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Could you post your refactoring log file?<span style="">  </span>Also, if you select the refacoring log &lt;projectName&gt;.refactorlog and look in the properties window (hit F4 to open the properties window) what is the build action for the .refactorlog file?</span></p><hr class="sig">Jamie Laflen, Developer, MicrosoftTue, 30 Jun 2009 16:44:14 Z2009-06-30T16:44:14Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#d375c1a7-67fe-43fa-baf7-7ab6d2975dachttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#d375c1a7-67fe-43fa-baf7-7ab6d2975dacJoyceWang_MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=JoyceWang_MSFTRefactoring not working when deploying<p>Ok, Ed, slow down... let's don't jump into the conclusion of having hope or no hope too quickly :-)<br/><br/>Let us back up a little bit. Could you do me a favor to try your mini scenario from scratch? I am trying to get a repro of your problem, but I couldn't. <br/><br/>Could you try the following:<br/><br/>1. Create a brand new database project<br/>2. Add a table Table_1<br/>3. Save your project<br/>4. In properties page, go to 'Deploy' tab.  Set to generate the script and deploy to database. Set the connection string to your target database. Note to give it a new database name, so that it won't overwrite your existing database. <br/>5. Deploy  &lt;-- check your target database, you should see the new table created. <br/>6. In your project, rename refactoring Table_1 to Table_11.<br/>7. Make sure there is a file &lt;project name&gt;.refactorlog added into your project.<br/>8. Save the project and deploy to the same databse in 5. &lt;-- note you don't need to change any setting in the properties page. <br/>9. At this stage, you should see the same target database with ONLY Table_11 in it.  &lt;-- if not, please share your deployment script with me. <br/><br/><br/>Ed, if you do not want to share stuffs in the forum, you can send me via email to ywang AT microsoft DOT com.<br/><br/>Thanks,<br/>Joyce</p>Tue, 30 Jun 2009 16:53:50 Z2009-06-30T16:53:50Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#1af9cd13-d93f-447b-b1e8-d6df8e929d72http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#1af9cd13-d93f-447b-b1e8-d6df8e929d72Jamie Laflen MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Jamie%20Laflen%20MSFTRefactoring not working when deploying<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Is it possible that your database project’s SQL version is different than the version of the target database?<span style="">  </span>There is a bug where refactoring does not work correctly if the versions are different.<span style="">  </span></span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">For instance, I have a SQL2005 project with a table I renamed from Table1 to Table1p.<span style="">  </span>The refactor log file looks like this:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;?</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">xml</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">version</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">1.0</span>&quot;<span style="color:blue"> </span><span style="color:red">encoding</span><span style="color:blue">=</span>&quot;<span style="color:blue">utf-8</span>&quot;<span style="color:blue">?&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">  </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">Rename Refactor</span>&quot;<span style="color:blue"> </span><span style="color:red">Key</span><span style="color:blue">=</span>&quot;<span style="color:blue">4183e395-8f14-4c3d-957b-f805430b1b52</span>&quot;<span style="color:blue"> </span><span style="color:red">ChangeDateTime</span><span style="color:blue">=</span>&quot;<span style="color:blue">06/30/2009 16:49:13</span>&quot;<span style="color:blue">&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[dbo].[Table1]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementType</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">ISql90Table</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[dbo]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementType</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">ISql90Schema</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">NewName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[Table1p]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">  </span>&lt;/</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;/</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span><span style="font-size:8pt"></span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">I then deploy to a SQL2008 database and the table Table1p is created.<span style="">  </span>If I change the logfile to be:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;?</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">xml</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">version</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">1.0</span>&quot;<span style="color:blue"> </span><span style="color:red">encoding</span><span style="color:blue">=</span>&quot;<span style="color:blue">utf-8</span>&quot;<span style="color:blue">?&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">  </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">Rename Refactor</span>&quot;<span style="color:blue"> </span><span style="color:red">Key</span><span style="color:blue">=</span>&quot;<span style="color:blue">4183e395-8f14-4c3d-957b-f805430b1b52</span>&quot;<span style="color:blue"> </span><span style="color:red">ChangeDateTime</span><span style="color:blue">=</span>&quot;<span style="color:blue">06/30/2009 16:49:13</span>&quot;<span style="color:blue">&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[dbo].[Table1]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementType</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="background:yellow;color:blue">ISql100Table</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[dbo]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementType</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">ISql90Schema</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">    </span>&lt;</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span><span style="font-family:'Courier New';color:blue;font-size:8pt"> </span><span style="font-family:'Courier New';color:red;font-size:8pt">Name</span><span style="font-family:'Courier New';color:blue;font-size:8pt">=</span><span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">NewName</span>&quot;<span style="color:blue"> </span><span style="color:red">Value</span><span style="color:blue">=</span>&quot;<span style="color:blue">[Table1p]</span>&quot;<span style="color:blue"> /&gt;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span style="">  </span>&lt;/</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;/</span><span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span><span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span><span style="font-size:8pt"></span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">You will also need to clear the __RefactorLog table of the row pertinent to this operation if you have already had a failed deployment to that database.</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">This bug has been fixed in the next version of Visual Studio.</span></p><hr class="sig">Jamie Laflen, Developer, MicrosoftTue, 30 Jun 2009 16:56:27 Z2009-06-30T16:56:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#333eacb4-0027-44d3-becd-aca11fb80475http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#333eacb4-0027-44d3-becd-aca11fb80475Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<blockquote> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Could you post your refactoring log file?<span>  </span> Also, if you select the refacoring log &lt;projectName&gt;.refactorlog and look in the properties window (hit F4 to open the properties window) what is the build action for the .refactorlog file?</span></p> <hr class=sig> Jamie Laflen, Developer, Microsoft</blockquote> <br/> Hi Jamie,<br/> <br/> Here is the content of the refactoring log file:<br/> <br/> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/> &lt;Operations&gt;<br/>   &lt;Operation Name=&quot;Rename Refactor&quot; Key=&quot;7a737e46-bb55-461b-bad2-30181a2f9ee1&quot; ChangeDateTime=&quot;06/26/2009 14:41:11&quot;&gt;<br/>     &lt;Property Name=&quot;ElementName&quot; Value=&quot;[dbo].[Table_1]&quot; /&gt;<br/>     &lt;Property Name=&quot;ElementType&quot; Value=&quot;ISql100Table&quot; /&gt;<br/>     &lt;Property Name=&quot;ParentElementName&quot; Value=&quot;[dbo]&quot; /&gt;<br/>     &lt;Property Name=&quot;ParentElementType&quot; Value=&quot;ISql90Schema&quot; /&gt;<br/>     &lt;Property Name=&quot;NewName&quot; Value=&quot;[Table_11]&quot; /&gt;<br/>   &lt;/Operation&gt;<br/> &lt;/Operations&gt;<br/> <br/> The build action is (apparently by default) Deployment Extension Configuration.<br/> <br/> Regards,<br/> <br/> Ed Tijgen <br/>Tue, 30 Jun 2009 17:41:35 Z2009-06-30T17:41:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#1295c4f3-3ce2-42aa-af88-087827cf301chttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#1295c4f3-3ce2-42aa-af88-087827cf301cEd Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<blockquote> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Is it possible that your database project’s SQL version is different than the version of the target database?<span>  </span> There is a bug where refactoring does not work correctly if the versions are different.<span>  </span> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">For instance, I have a SQL2005 project with a table I renamed from Table1 to Table1p.<span>  </span> The refactor log file looks like this:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;?</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">xml</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">version</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">1.0</span> &quot;<span style="color:blue"> </span> <span style="color:red">encoding</span> <span style="color:blue">=</span> &quot;<span style="color:blue">utf-8</span> &quot;<span style="color:blue">?&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>  </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">Rename Refactor</span> &quot;<span style="color:blue"> </span> <span style="color:red">Key</span> <span style="color:blue">=</span> &quot;<span style="color:blue">4183e395-8f14-4c3d-957b-f805430b1b52</span> &quot;<span style="color:blue"> </span> <span style="color:red">ChangeDateTime</span> <span style="color:blue">=</span> &quot;<span style="color:blue">06/30/2009 16:49:13</span> &quot;<span style="color:blue">&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[dbo].[Table1]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementType</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">ISql90Table</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[dbo]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementType</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">ISql90Schema</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">NewName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[Table1p]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>  </span> &lt;/</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;/</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">I then deploy to a SQL2008 database and the table Table1p is created.<span>  </span> If I change the logfile to be:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;?</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">xml</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">version</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">1.0</span> &quot;<span style="color:blue"> </span> <span style="color:red">encoding</span> <span style="color:blue">=</span> &quot;<span style="color:blue">utf-8</span> &quot;<span style="color:blue">?&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>  </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">Rename Refactor</span> &quot;<span style="color:blue"> </span> <span style="color:red">Key</span> <span style="color:blue">=</span> &quot;<span style="color:blue">4183e395-8f14-4c3d-957b-f805430b1b52</span> &quot;<span style="color:blue"> </span> <span style="color:red">ChangeDateTime</span> <span style="color:blue">=</span> &quot;<span style="color:blue">06/30/2009 16:49:13</span> &quot;<span style="color:blue">&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[dbo].[Table1]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ElementType</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="background:yellow none repeat scroll 0% 0%;color:blue">ISql100Table</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[dbo]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">ParentElementType</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">ISql90Schema</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>    </span> &lt;</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Property</span> <span style="font-family:'Courier New';color:blue;font-size:8pt"> </span> <span style="font-family:'Courier New';color:red;font-size:8pt">Name</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">=</span> <span style="font-family:'Courier New';font-size:8pt">&quot;<span style="color:blue">NewName</span> &quot;<span style="color:blue"> </span> <span style="color:red">Value</span> <span style="color:blue">=</span> &quot;<span style="color:blue">[Table1p]</span> &quot;<span style="color:blue"> /&gt;</span> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt"><span>  </span> &lt;/</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operation</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:8pt">&lt;/</span> <span style="font-family:'Courier New';color:#a31515;font-size:8pt">Operations</span> <span style="font-family:'Courier New';color:blue;font-size:8pt">&gt;</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">You will also need to clear the __RefactorLog table of the row pertinent to this operation if you have already had a failed deployment to that database.</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">This bug has been fixed in the next version of Visual Studio.</span></p> <hr class=sig> Jamie Laflen, Developer, Microsoft</blockquote> <br/> Hi Jamie,<br/> <br/> The db project type is sql server 2008 and the target database is also 2008. In my refactorlog ( as I posted earlier ) the elementtype is <span style="font-family:'Courier New';font-size:8pt"><span style="background:yellow none repeat scroll 0% 0%;color:blue">ISql100Table<br/> <br/> Regards,<br/> <br/> Ed Tijgen</span> </span>Tue, 30 Jun 2009 17:46:14 Z2009-06-30T17:46:14Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#ed2558b6-dbd1-4b16-bbbf-874177f7fb99http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#ed2558b6-dbd1-4b16-bbbf-874177f7fb99Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<p><br/>Hi All,</p> <p>my appologies for missing something important.</p> <p>The __Refactorlog table was created but it was put in the system tables folder. This is why i missed it. However the __RefactorLog table remains empty</p> <p>Regards,</p> <p>Ed Tijgen</p>Tue, 30 Jun 2009 18:03:36 Z2009-06-30T18:03:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#a20b0780-9e5b-4121-a71b-13175caa67e2http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#a20b0780-9e5b-4121-a71b-13175caa67e2Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<blockquote> <p>Ok, Ed, slow down... let's don't jump into the conclusion of having hope or no hope too quickly :-)<br/><br/>Let us back up a little bit. Could you do me a favor to try your mini scenario from scratch? I am trying to get a repro of your problem, but I couldn't. <br/><br/>Could you try the following:<br/><br/>1. Create a brand new database project<br/>2. Add a table Table_1<br/>3. Save your project<br/>4. In properties page, go to 'Deploy' tab.  Set to generate the script and deploy to database. Set the connection string to your target database. Note to give it a new database name, so that it won't overwrite your existing database. <br/>5. Deploy  &lt;-- check your target database, you should see the new table created. <br/>6. In your project, rename refactoring Table_1 to Table_11.<br/>7. Make sure there is a file &lt;project name&gt;.refactorlog added into your project.<br/>8. Save the project and deploy to the same databse in 5. &lt;-- note you don't need to change any setting in the properties page. <br/>9. At this stage, you should see the same target database with ONLY Table_11 in it.  &lt;-- if not, please share your deployment script with me. <br/><br/><br/>Ed, if you do not want to share stuffs in the forum, you can send me via email to ywang AT microsoft DOT com.<br/><br/>Thanks,<br/>Joyce</p> </blockquote> <p><br/>Hi Joyce,</p> <p>I have followed your instructions to the letter.<br/>Still a table is added instead of being renamed.</p> <p>However I do see something new in the refactorlog:<br/>-- Refactoring step to update target server with deployed transaction logs<br/>CREATE TABLE  __RefactorLog (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)<br/>GO<br/>sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'<br/>GO<br/><br/>!UPDATE! I now beleive the bove statement was once executed in my other project aswell becuase there I find the __RefactorLog table aswell, the reason i missed it is it is in the system tables folder. However in both db project ( the initial, and this new one) the __Refactorlog table remains empty and nothing is refactored.</p> <p>Here is the complete log file:<br/>/*<br/>Deployment script for RefactorTry2<br/>*/</p> <p>GO<br/>SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;</p> <p>SET NUMERIC_ROUNDABORT OFF;</p> <p><br/>GO<br/>:setvar DatabaseName &quot;RefactorTry2&quot;<br/>:setvar DefaultDataPath &quot;E:\_data\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\&quot;</p> <p>GO<br/>USE [master]</p> <p>GO<br/>:on error exit<br/>GO<br/>IF (DB_ID(N'$(DatabaseName)') IS NOT NULL<br/>    AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') &lt;&gt; N'ONLINE')<br/>BEGIN<br/>    RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT<br/>    RETURN<br/>END</p> <p>GO</p> <p>IF NOT EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)')<br/>BEGIN<br/>    RAISERROR(N'You cannot deploy this update script to target DIVERSITYMOBILE. The database for which this script was built, RefactorTry2, does not exist on this server.', 16, 127) WITH NOWAIT<br/>    RETURN<br/>END</p> <p>GO</p> <p>IF (@@servername != 'DIVERSITYMOBILE')<br/>BEGIN<br/>    RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'DIVERSITYMOBILE',@@servername) WITH NOWAIT<br/>    RETURN<br/>END</p> <p>GO</p> <p>IF CAST(DATABASEPROPERTY(N'$(DatabaseName)','IsReadOnly') as bit) = 1<br/>BEGIN<br/>    RAISERROR(N'You cannot deploy this update script because the database for which it was built, %s , is set to READ_ONLY.', 16, 127, N'$(DatabaseName)') WITH NOWAIT<br/>    RETURN<br/>END</p> <p>GO<br/>USE [$(DatabaseName)]</p> <p>GO</p> <p>GO<br/>/*<br/> Pre-Deployment Script Template                           <br/>--------------------------------------------------------------------------------------<br/> This file contains SQL statements that will be executed before the build script.   <br/> Use SQLCMD syntax to include a file in the pre-deployment script.           <br/> Example:      :r .\myfile.sql                               <br/> Use SQLCMD syntax to reference a variable in the pre-deployment script.       <br/> Example:      :setvar TableName MyTable                           <br/>               SELECT * FROM [$(TableName)]                   <br/>--------------------------------------------------------------------------------------<br/>*/</p> <p>GO</p> <p>GO<br/>PRINT N'Creating dbo.Table_11...';</p> <p><br/>GO<br/>CREATE TABLE [dbo].[Table_11] (<br/>    [column_1] INT NOT NULL,<br/>    [column_2] INT NULL<br/>);</p> <p><br/>GO</p> <p>GO<br/>/*<br/>Post-Deployment Script Template                           <br/>--------------------------------------------------------------------------------------<br/> This file contains SQL statements that will be appended to the build script.       <br/> Use SQLCMD syntax to include a file in the post-deployment script.           <br/> Example:      :r .\myfile.sql                               <br/> Use SQLCMD syntax to reference a variable in the post-deployment script.       <br/> Example:      :setvar TableName MyTable                           <br/>               SELECT * FROM [$(TableName)]                   <br/>--------------------------------------------------------------------------------------<br/>*/</p> <p>GO<br/>-- Refactoring step to update target server with deployed transaction logs<br/>CREATE TABLE  __RefactorLog (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)<br/>GO<br/>sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'<br/>GO</p> <p>GO</p> <p>GO</p> <p><br/>I hope this helps shining a light on this.</p> <p>Thanks in advance,</p> <p>Ed Tijgen</p> <p> </p>Tue, 30 Jun 2009 18:06:21 Z2009-06-30T18:06:21Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f7551e85-34bf-4074-af07-b3a4e06307cdhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f7551e85-34bf-4074-af07-b3a4e06307cdJoyceWang_MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=JoyceWang_MSFTRefactoring not working when deployingEd,<br/><br/>Is this the deploy script from the second time? I don't understand why it still has the following piece. Creating the __RefactorLog should be done in the first-time deployment (step 5).  Do you have 'Always re-create database' option checked in Database.sqldeployment?<br/><br/> <pre lang=x-sql>-- Refactoring step to update target server with deployed transaction logs CREATE TABLE __RefactorLog (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY) GO sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog' GO </pre> The refactorlog you provided all seems OK. So I assume refactoring itself succeeded. Then in the next deploy, you should see in the deployment script something like below<br/><br/> <pre>PRINT N'The following operation was generated from a refactoring log file 17165144-551c-47dc-8758-209c7595015e'; PRINT N'Rename [dbo].[Table1] to Table11'; GO EXECUTE sp_rename @objname = N'[dbo].[Table1]', @newname = N'Table11', @objtype = N'OBJECT'; GO -- Refactoring step to update target server with deployed transaction logs INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('17165144-551c-47dc-8758-209c7595015e') GO </pre>Tue, 30 Jun 2009 18:57:27 Z2009-06-30T18:57:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#c91241c3-213b-4e5e-8cd5-b8dd1d78d58bhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#c91241c3-213b-4e5e-8cd5-b8dd1d78d58bJamie Laflen MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Jamie%20Laflen%20MSFTRefactoring not working when deploying<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Hi Ed,</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">A couple questions:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="text-indent:-0.25in;margin:0in 0in 0pt 0.5in"><span style="font-family:Symbol"><span style=""><span style="font-size:x-small">·</span><span style="font:7pt &quot;Times New Roman&quot;">         </span></span></span><span style="font-size:x-small">The version of GDR is:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in"><span style="font-size:x-small">Microsoft Visual Studio Team System 2008 Database Edition GDR Version 9.1.40413.00</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="text-indent:-0.25in;margin:0in 0in 0pt 0.5in"><span style="font-family:Symbol"><span style=""><span style="font-size:x-small">·</span><span style="font:7pt &quot;Times New Roman&quot;">         </span></span></span><span style="font-size:x-small">Are you saying that on the second deploy you see the creation of the __RefactorLog table but not any values inserted into it?</span></p> <p class=MsoNoSpacing style="text-indent:-0.25in;margin:0in 0in 0pt 0.5in"><span style="font-family:Symbol"><span style=""><span style="font-size:x-small">·</span><span style="font:7pt &quot;Times New Roman&quot;">         </span></span></span><span style="font-size:x-small">This is a brand new project against a new database (just confirming)?</span></p> <p class=MsoNoSpacing style="text-indent:-0.25in;margin:0in 0in 0pt 0.5in"><span style="font-family:Symbol"><span style=""><span style="font-size:x-small">·</span><span style="font:7pt &quot;Times New Roman&quot;">         </span></span></span><span style="font-size:x-small">You are using the same credentials to deploy both times?</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">I have the GDR version mentioned above and I cannot reproduce exactly the same behavior you are seeing.<span style="">  </span>I am sure there is something simple I am missing that would enable me to repro the problem!</span></p><hr class="sig">Jamie Laflen, Developer, MicrosoftTue, 30 Jun 2009 21:01:55 Z2009-06-30T21:01:55Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#584c5b73-314b-4491-b698-c8a2f022feechttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#584c5b73-314b-4491-b698-c8a2f022feecEd Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<blockquote>Ed,<br/> <br/> Is this the deploy script from the second time? I don't understand why it still has the following piece. Creating the __RefactorLog should be done in the first-time deployment (step 5).  Do you have 'Always re-create database' option checked in Database.sqldeployment?<br/> <br/> <div style="color:Black;background-color:White"> <pre><span style="color:Green">-- Refactoring step to update target server with deployed transaction logs</span> <br/> <span style="color:Blue">CREATE</span> <span style="color:Blue">TABLE</span> __RefactorLog (OperationKey <span style="color:Blue">UNIQUEIDENTIFIER</span> <span style="color:Blue">NOT</span> <span style="color:Blue">NULL</span> <span style="color:Blue">PRIMARY</span> <span style="color:Blue">KEY</span> )<br/> GO<br/> sp_addextendedproperty N<span style="color:#a31515">'microsoft_database_tools_support'</span> , N<span style="color:#a31515">'refactoring log'</span> , N<span style="color:#a31515">'schema'</span> , N<span style="color:#a31515">'dbo'</span> , N<span style="color:#a31515">'table'</span> , N<span style="color:#a31515">'__RefactorLog'</span> <br/> GO <br/> </pre> </div> The refactorlog you provided all seems OK. So I assume refactoring itself succeeded. Then in the next deploy, you should see in the deployment script something like below<br/> <br/> <pre>PRINT N'The following operation was generated from a refactoring log file 17165144-551c-47dc-8758-209c7595015e';<br/> <br/> PRINT N'Rename [dbo].[Table1] to Table11';<br/> <br/> GO<br/> EXECUTE sp_rename @objname = N'[dbo].[Table1]', @newname = N'Table11', @objtype = N'OBJECT';<br/> <br/> GO<br/> -- Refactoring step to update target server with deployed transaction logs<br/> INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('17165144-551c-47dc-8758-209c7595015e')<br/> <br/> GO<br/> </pre> </blockquote> Hi Joyce,<br/> <br/> This is the script from the second time yes. And I do not have the &quot;Always recreate database&quot; option checked<br/> <br/> Regards,<br/> <br/> Ed Tijgen <br/>Wed, 01 Jul 2009 07:26:37 Z2009-07-01T07:26:37Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#8fe233f9-05c5-424d-bc64-64a787a53a37http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#8fe233f9-05c5-424d-bc64-64a787a53a37Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deploying<blockquote> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:x-small">Hi Ed,</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">A couple questions:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in"><span style="font-family:Symbol"><span><span style="font-size:x-small">·</span> <span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal">         </span> </span> </span> <span style="font-size:x-small">The version of GDR is:</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in"><span style="font-size:x-small">Microsoft Visual Studio Team System 2008 Database Edition GDR Version 9.1.40413.00</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in"><span style="font-family:Symbol"><span><span style="font-size:x-small">·</span> <span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal">         </span> </span> </span> <span style="font-size:x-small">Are you saying that on the second deploy you see the creation of the __RefactorLog table but not any values inserted into it?</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in"><span style="font-family:Symbol"><span><span style="font-size:x-small">·</span> <span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal">         </span> </span> </span> <span style="font-size:x-small">This is a brand new project against a new database (just confirming)?</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in"><span style="font-family:Symbol"><span><span style="font-size:x-small">·</span> <span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal">         </span> </span> </span> <span style="font-size:x-small">You are using the same credentials to deploy both times?</span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small"> </span></p> <p class=MsoNoSpacing style="margin:0in 0in 0pt"><span style="font-size:x-small">I have the GDR version mentioned above and I cannot reproduce exactly the same behavior you are seeing.<span>  </span> I am sure there is something simple I am missing that would enable me to repro the problem!</span></p> <hr class=sig> Jamie Laflen, Developer, Microsoft</blockquote> <br/> Hi Jamie,<br/> <br/> I have GDR Version 9.1.40413.00.<br/> <br/> I am using a new db with a new db project.<br/> <br/> The __RefactorLog table is not created while I have no &lt;dbproject&gt;.refactorlog in my db project.<br/> <br/> Only table_11 is added (so now I have 2 tables. table_1 and table_11). So I remove table_11 again.<br/> <br/> Once I do a refactor action (and a &lt;dbproject&gt;.refactorlog is created) and I deploy the __RefactorLog table is created (it is a part of my sql deploy script) but is left empty. Once again the table_1 is not renamed but table_11 is added.<br/> <br/> If I deploy a 3rd time the creation of the __RefactorLog table is omited.<br/> <br/> Regards,<br/> <br/> Ed Tijgen<br/> <br/> <br/> <br/>Wed, 01 Jul 2009 07:41:52 Z2009-07-01T07:41:52Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f38c8cbe-7e36-4fe7-b444-6abfbd352108http://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#f38c8cbe-7e36-4fe7-b444-6abfbd352108Ed Tijgenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20TijgenRefactoring not working when deployingHI All,<br/> <br/> Thanks so much for your time and efforts.<br/> <br/> I am not sure that anything changed wince a few minutes ago, so I (or someone else) might run into the same problem again sometime in the future.<br/> But somehow completely automagicly the refactoring is working.<br/> <br/> For now, especially seeing how much support you guys are giving the community, I am confident to start using db projects in our organization.<br/> <br/> Once again many thanks.<br/> <br/> Regards,<br/> <br/> Ed Tijgen<br/>Wed, 01 Jul 2009 07:45:11 Z2009-07-01T07:45:11Zhttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#18a0f9c4-6c65-4e67-adbc-72c720add9fchttp://social.msdn.microsoft.com/Forums/en-US/vstsdb/thread/53207164-87fa-4bc8-a94e-d9f660a8aeeb#18a0f9c4-6c65-4e67-adbc-72c720add9fcJoyceWang_MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=JoyceWang_MSFTRefactoring not working when deployingEd -  we are glad to know that the whole thing worked out for you :-) Wed, 01 Jul 2009 15:53:36 Z2009-07-01T15:53:36Z