0

Simply put:

  • I am trying to use a visual studio database project to update my sql server database
  • I change the names of the table columns by using the refactoring tool
  • Once the column names are changed I do a schema comparison before making any final changes to the database
  • However, I notice that it will drop the column who's name has been changed and then immediately re-adds it (this obviously leads to data loss which I don't want)
  • How then can I change the settings in someway to make it do a simple change not a drop/add when changing the names of the columns

1 Answers1

0

See this for renaming columns. Not sure about VS diff code generation, you might have to modify the generated script yourself.

Community
  • 1
  • 1
tne
  • 7,071
  • 2
  • 45
  • 68
  • Unfortunately, if I were to go in and modify each one manually I would also have to modify all 600 references manually as well (that's a literal number by the way), and in most cases that's just for one table. I have 40+ tables to modify, so I really need an automated solution. – brykim1 Mar 22 '15 at 00:58
  • @brykim1 Understood; it's a shame. You'll probably want to find/file a report on Connect or the UserVoice site, and hack something in the meantime. There might be third-party tools to help with that. It could also be that there is a reason why they don't do it automatically, and you'd thus want to know about it. – tne Mar 22 '15 at 15:45