Looking for a good "create" database scripting tool (not diff scripting) - msbuild

I'm looking for a db script tool which can do the following:
Create "create-scripts" for each table in the database and place them in separate files. Note: these files should not contain relational constraints.
Create scripts for relational constraints (as one file or many, doesn't matter)
Create insert scripts for populating tables.
We are going to put the scripts into tfs and they will be updated fairly often, so a tool which is fast and efficient to is highly preferred. I'm going to integrate these scripts into msbuild to create a database for our integration tests.

You should use Visual Studio Database Professional. If you are using Visual Studio 2010 it is included with Ultimate (and perhaps other versions). For Visual Studio 2008 Team Developer it is a free download. It is fantastic and easy to deploy using MSBuild. All of the scripts that you store are create scripts, broken down by type similar to what you specified in your question.

Related

how to use phpmyadmin database in visual studio 2010?

I have my database in phpmyadmin.
Now I have to use that database in SQL server database.
But I cannot import .SQL file into visual studio 2010.
So please give me a solution so that I can use that database and perform CRUD operation also.
Okay so im trying to help you dude. but first, you must understand that phpmyadmin is just an RDMS environment for accessing, configuring, managing, administering, and developing all components of the RDMS. So what does it mean? you can still work on visual studio probably c# or vb (i guess) so you can perform a CRUD operation. How? these are the things you need to do:
know how to connect your prepared .net language (c# or vb) - you might need to look at Connector/NET mysql. you can google, its free.
familiarized on the said library.
find some tutorial on how to do crud operation. maybe this article is great for you. Good Luck

VS style snippets in SSMS 2012. Do they exist?

I am trying to setup a simple snippet in SQL Server management studio. When I heard the word "snippet", I assume that they would work like they do in Visual Studio. By that I mean that there are variables that get filled in, etc... I am not seeing that.
Can someone tell me whether SSMS 2012 supports Visual Studio style snippets. If so, can you provide an example of a snippet that supports variable replacement.
This might be close to what your looking for. Under View->Template explorer is a list of a whole bunch of structures that you regularly use when working with, building, developing databases. You can also get to it using Ctrl+Alt+T. There are literally hundreds in there. Everything from building a view to setting up a trigger to creating XML schemas.
The really nice thing with templates is you can build your own structures that you regularly use. I have built quite of few of my own templates to hold snippets that I have acquired from the likes of Brent Ozars blitz scripts and others like the improved SP_WHO from Adam Machanic and such.
While maybe not as fancy (read interactive) as the ones you'll find in the Visual Studio projects I find them very handy.
If you use these templates there is another little feature that can be very handy. If you press Ctrl-Shift-M (or use the toolbar button that shows an A->B) you get a dialog that lets you easily replace the template parameters with your own values.
Update post research into SSMS2012
I just recently started using SSMS 2012 and see there is a new feature that I wasn't aware of. When right clicking you do in fact see the 'Insert Snippet' drop down. I understand your question better now. Apparently however, these are pretty much the same as what I posted above.

How do I fork a VS 2010 VB Solution

I've written a bare-bones ap in Visual Studio 2010, Express version. It does what I need and several others are using it successfully. I'd like to add features to it, but I don't want to foreclose the ability to make corrections to the present version.
How do I make a fork in the application for this purpose? Google has been no help in this case, and I've tried several incarnations of copy and change names etc etc.
Ensure you have a Source Code Revision Control System in place (Subversion, TFS, Git etc.), and then create a branch. That way all names stay the same.
One technique is to create a branch (from the trunk, or a previous branch from trunk) for each different production version you want to support. That way, merging chnages up/down between versions and current development is (usually) relatively straightforward.
Even if you are not using Subversion, the 'Red Bean' book is a great place to learn about branching strategy.
Visual Studio 2010, Express edition doesn't integrate directly with source control systems. This is one of the product limitations (i.e. what makes it the 'express' license).
I would recommend either:
1. using a product like SVN or Mercurial, which you use outside the Visual Studio IDE
2. depending on the complexity of the changes, you may want to look at conditional compilation. It's kind of like a poor man's code branch.

Script or automate feature class creation in ESRI/ArcSDE

I'm looking for info on how to write SQL scripts to automate the creation of a versioned feature class in ArcSDE I want to be able to automate the process itself as well as put the scripts under version control. Can anyone point me to a resource that explains how to do this?
Is this even possible? It seems like there are lots of interrelationships between tables and data when a feature class is added.
P.S. It doesn't have to be pure SQL, but it should be some kind of scripting so we can save to version control and run outside of ESRI desktop tools.
It would be exceedingly difficult to do this in SQL without breaking your database. As you indicated, there are a lot of relationships between the tables, and if you don't get it right, then your database is messed up.
If you're looking at a scripted solution, you might want to look at creating a Python script to create the versioned feature class. There are a few ways to do it, from creating a raw Python script in Notepad, to creating a geoprocessing model in ArcCatalog and exporting the model to a Python script.
Here's a link to the ESRI help on geoprocessing scripts: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_writing_geoprocessing_scripts

How to edit default templates for database objects using VSTS 2008 Database Edition GDR Version

I'm giving Visual Studio Team System 2008 Database Edition (GDR Version) a go on a new project I'm working on and have come up against a slightly annoying problem that I am hoping someone knows how to resolve.
In a nutshell, I would like to alter the default templates used to generate database objects, particularly stored procedures. In the past, using SSMS, I have simply created my own templates which contain the formatting, default number of parameters, etc, that I would generally like to use whenever I create a new sproc. This obviously eliminates a good amount of hand coding and just "feels right" to me to have some consistency in my T-SQL code.
I've tried editing the .sql files located in ..\Microsoft Visual Studio 9.0\DBPro\Items by adding the formatting and default constructs I would like to use. Unfortunately, I haven't been able to get VSTS to recognize these changes. When I add a new stored procedure using the GUI it still uses the default stored procedure formatting.
I've tried shutting down Visual Studio and starting it back up after making these adjustments, but that doesn't seem to have any effect.
Does anyone know how to do this? I haven't been able to find any documentation on MSDN or the DBPro teams' blogs, but I have a feeling this can done. Any help or suggestions would be greatly appreciated.
Microsoft Visual Studio 9.0\DBPro\Items is a legacy directory. These are the wrong templates. The right templates are in Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\Items. Editing these works, and you don't even have to close visual studio.