How to Develop TSQL in Visual Studio 2010 Database Projects

Silly sounding question, I know... Let me lay some groundwork first.

I have successfully created a database project comprised of the hundreds of tables, stored procedures, indexes, et.al. that make up our production database.

I have successfully added the solution to source control (TFS).

I have made a change (as a test) to some of the objects and generated a deployment script, and the whole system is very impressive, I must say. But it seems the strength of VS 2010, from a DB perspective is deployment, and not necessarily development.

I am totally baffled on the day-to-day workflow involved in database/TSQL development using Visual Studio. Let's suppose I need to add a few columns to a table, and modify related stored procedures to return/update this data for these columns.

While it's easy enough to modify all the scripts in my database model, I'd like to be able to isolate them against a dev database where I can do some testing... But it's as simple as not being to update a proc if it exists without manually changing the script to an ALTER (or adding DROP code prior to the CREATE). Having to do this once or twice is a non-issue, but in a real dev environment, we do this all day long.

Perhaps the answer is to perform frequent deployments to the dev server, as I debug and make changes to procs, for instance? Quite a bit of overhead; I could execute the necessary scripts manually in a few seconds, building and deploying takes a few minutes. Plus, if three of us are deploying different changes to a dev DB, wouldn't we overwrite each other's modifications?

Sorry to be so longwinded, but I can't help but think I am missing something simple here.

Are there any books/tutorials/webinars that showcase this type of approach to actual development?

10
задан Shoeless 24 August 2010 в 21:20
поделиться

1 ответ

Я думаю, вы попали в самую точку. Чтобы протестировать измененные хранимые процедуры, вам необходимо пройти этап развертывания, чтобы обновить базу данных. Это недостаток автономной модели разработки.

Здесь, в Red Gate, к нам поступило множество запросов на то, чтобы обеспечить поддержку SQL Source Control проекта базы данных, что позволило бы разработчикам пользоваться преимуществами «онлайновой» модели разработки, сохраняя при этом преимущества функций проекта базы данных.

[EDIT] Мы добавили «бета-поддержку» для проекта базы данных в системе управления версиями SQL, что позволяет разрабатывать подключенные SSMS в соответствии с форматом проекта базы данных. Простая ссылка на папку с файлом .sqlproj из системы управления версиями SQL и начинайте разработку! [/EDIT]

Тем временем вам придется регулярно выполнять развертывание для разработчиков!

Альтернативой является разработка на основе реальной базы данных и использование функции сравнения схем для синхронизации с вашим проектом базы данных. Функция сравнения схем доступна в выпусках Visual Studio Premium и Ultimate.

Дэвид Аткинсон Менеджер по продукту Программное обеспечение Red Gate

6
ответ дан 4 December 2019 в 03:14
поделиться
Другие вопросы по тегам:

Похожие вопросы: