Using T4 Templates with Visual Studio 2010 Database Projects

  I had a request to update my Visual Studio 2008 GDR Database projects CRUD generator to Visual Studio 2010. Not much has changed except for some references and directory locations. The flow of the add-in is identical to the 2008 version. Below are the pertinent links. Original blog entry Source Code Visual Studio 2010…

5

Database Project Extensibility – Merge Table and View Scripts

  In this blog I’ve created a project feature extension to combine Table and View child scripts into the script that defines the parent object. For example, constraints or extended properties for a table. Some developers like to have all the T-SQL scripts defining a particular object in one .sql file. Typically you’d run this…

1

Template Driven Sql Generation Updated for Visual Studio 2010

More than a year ago I presented a simple template processor for Visual Studio 2008 Database Projects. This add-in gives you the ability to write Transact-SQL in a simple template form with embedded SQLCMD variables. It’ll turn –*CREATE TABLE [dbo].[$(MyVar)] –*( –* column_1 int NOT NULL, –* column_2 int NULL –*) Into valid Transact-SQL CREATE…

2

Converting .dbp files to .dbproj files

With the release of Visual Studio 2010 Beta 2, database projects with the .dbp extension are deprecated. There are several ways to convert your project manually Import Script. Unfortunately this will shred your scripts for schema objects and move any conditional logic into the scriptsignored file. Add Existing Item. You could create a Visual Studio…

0

Interesting Memory Leak in .Net 3.5 Binary Deserialization

Recently I was analyzing an application written in managed code for memory problems.  In managed code a common cause of eating up memory is statically allocated objects which are not nulled out after they are no longer needed. In the application I was debugging it was making use of binary deserialization to reconstruct a graph…

5

Sample Visual Studio 2008 Fonts and Color Provider

Adding a new Font and Color category to the Visual Studio Options dialog is, admittedly, a little tricky. There are several services your package must proffer, an interface you must implement and registry keys you must provide (one of them very poorly named!). I was recently asked to provide a fully working sample to help…

0

Template Driven Sql Generation

Recently Duke Kamstra and I demonstrated how you can use Visual Studio 2008 Database and Server projects to deploy Sql Server permission objects to your various Sql Server instances. It’s common to develop on a local box with admin rights, and then restrict those rights as you start deploying to test, pre-production and, eventually, your…

9

Using T4 Templates with GDR Database Projects

For this blog I’ve developed an add-in for General Distribution Release (GDR) for Visual Studio Team System 2008 Database Edition projects (better known as “Data Dude”) which will generate Create, Read, Update and Delete (CRUD) stored procedures for a particular table in your model.  I wanted to provide the ability to affect the content of…

15

Navigating the Data Dude Object Model

In this blog I’ll introduce you to the basics of navigating the General Distribution Release (GDR) for Visual Studio Team System 2008 Database Edition object model. I’ve wrapped it all into an add-in so you can step through the code and extend it as you wish. I hope you find it useful! The first part…

2

Database Project Import Scripts Add In

In this blog I’ll introduce you to the Import Scripts add-in to the General Distribution Release (GDR) for Visual Studio Team System 2008 Database Edition. With this add-in Visual Studio can import multiple scripts to populate a target database project. I’ve included the source code but, in order to compile the install project you’ll need…

3