views:

43

answers:

1

Am I missing something here? It seems that the only options to create a new table in a database project in VS2010 is:

Create a table object as a file, then create all constraints (defaults) as separate files, then create each index as a separate file, and primary key as a separate file and on and on...

Or

Create the entire table schema using the table designer in SSMS and then use the schema compare tool to create a single monolithic file of SQL statements for each element of the table and copy each block of code to a newly created file in VS.

This question was asked 2 years ago and I'm hoping the answer has changed. Please tell me there's a hidden table designer for the database project in VS2010 that I have just overlooked.

A: 

I'm pretty sure there isn't one!

Can I ask why you need a table designer over creating and modifying creation script files for your new objects? Is there anything that this doesn't give you that a designer would?

David Atkinson
@David, I prefer a designer in this case for the same reason I use other coding tools (like VS), rather than coding in notepad. Convenience, increased productivity and reliability. Hopefully, you'd agree that some code is so "Boiler-plate" that it is generated and maintained quicker and more reliably by a tool than by a human. When "under-the-gun", I'd rather spend my time and thought processes on business logic than mind-numbing "ALTER TABLE xxx ADD CONSTRAINT xxx blah, blah blah" statements.
Richard B
@David, after looking at your profile and seeing that you work for Red Gate, I might add that other coding tools I use for similar reasons include: Red Gate's SQL Prompt, Refactor, Data Gen, Docs and previously, Packager. You, out of all, should understand my desire for a table designer.
Richard B
The whole point about VS2010's offline script model is that it doesn't require you to form difficult-to-remember ALTER statements to modify your objects. You're defining the CREATE scripts (from a template starting point) and when this is deployed to a database, the hard stuff is done by the engine underneath.
David Atkinson
Many users have been asking us to 1) support the VS database project and 2) develop a designer, so we're actively looking into it. At the moment the way SQL Source Control works is to let you develop on a real database, and therefore you can benefit from using the existing designers in SSMS. Sadly SQL Source Control doesn't (yet) support the VS2010 database project, so if you're stuck with that, your options are sadly limited, at least for now.
David Atkinson
@David, Thanks for taking the time to respond. Although I really like your products, I think for the $$$$$ MS is charging for VSTS with the Datadude module, it should at least have the programing features of SSMS without the need for 3rd party plugins. Regarding your first response to my response, I'm a little mystified. I'm not aware of a "CREATE" statement for table constraints... The only one I know of is within the "ALTER TABLE" statement (as alluded to in my first response). I'm fully aware the requirement to only use "CREATE" statements.
Richard B
Yes, you're entirely right. Constraints can only be represented as ALTERs to a table, so I acknowledge that everything's not as simple as it could be. I can't really speak for Microsoft, so I don't understand why the designers aren't present. However, if Red Gate decides to support the VS 2010 Database Project, I'll post to this thread and let you know. That's as much as I can contribute from where I'm standing.
David Atkinson

related questions