Saturday, June 14, 2008

LINQPad – Cool Utility For LINQ

Maybe you know about this, but I saw it first few days a go. I feel in love.linqpadlogo

LINQPad is a cool little utility that was mainly created to allow you to test LINQ expressions and see them produce a  result and output the results in a nice easy to visualize format. It's great for running LINQ Queries without having to fire up Visual Studio.

LINQPad is also a great way to learn LINQ: it comes preloaded with 200 examples from the book,"C# 3.0 in a Nutshell" written by Joseph Albahari, the author of LINQPad.  There's no better way to experience the coolness of LINQ and functional programming.

LINQPad is more than just a LINQ query tool: it's a code snippet IDE. Instantly execute any C# 3 or VB 9 expression or statement block! LINQPad does a great job at LINQ execution and visualization, but it has a lot more uses than just a LINQ query tool. It's basically a snippet editor that allows you to save snippets and more importantly, execute just about any code that you can write as an expression or single function block.

For example, LINQ to SQL results:

linqpad1

Output can be displayed both as a result table view, the raw SQL (from .ToString()) and a useful code conversion from the LINQ Expression syntax to LINQ command syntax using command chaining of the various LINQ extensions methods.

Other example (from the preloaded examples):

linqpad2

There's no installation - it's a single self contained EXE you can copy anywhere assuming you have .NET 3.5 installed.

Download it here.

 

Share this post :

Thursday, June 12, 2008

Configure Team Foundation Build for an Incremental Build

A question I got today: "How can I configure my Team Build for an incremental build?".

So, it's simple.

Team Build 2005

Add the PropertyGroup definition to the end of the TFSBuild.proj file, before the closing </project> tag.

Set the following properties:

   <PropertyGroup>
<SkipClean>true</SkipClean>
<SkipInitializeWorkspace>true</SkipInitializeWorkspace>
<ForceGet>false</ForceGet>
</PropertyGroup>


 



Team Build 2008




Set IncrementalBuild property to true. To do it, add the PropertyGroup definition to the end of the TFSBuild.proj file, before the closing </project> tag.

   <PropertyGroup>
<IncrementalBuild>true</IncrementalBuild>
</PropertyGroup>


 



Source - msdn:



Team Build 2005: http://msdn.microsoft.com/en-us/library/aa833876(VS.80).aspx



Team Build 2008: http://msdn.microsoft.com/en-us/library/aa833876.aspx

Monday, June 9, 2008

Templex-Sharing Team System Process Templates

We always asked for a library of process templates available and also easy way to share ones we created.

Templex is a new CodePlex project has just been created for this purpose. 

From the project’s page:

This CodePlex projects serves as a repository for open source Team Foundation Server (TFS) process templates, work item type definitions and report definitions. TFS uses process templates to configure new team projects. Each process template includes the following:

  • TFS Security groups and permissions
  • Initial set of Areas and Iterations
  • Work item type definitions
  • Initial set of work items
  • Work item querys
  • MS Project Mappings
  • Version control permissions and settings for check-out and check-in
  • Project portal document library settings, including an initial set of documents
  • SQL Reporting Services report definitions

Once a team project is created, the following configuration items can be imported, exported and modified:
  • Work item type definitions
  • Work item queries
  • Report definitions

 

 

http://www.codeplex.com/templex

Wednesday, June 4, 2008

VSTS 2008 Database Edition GDR June CTP

Yesterday, at TechEd 2008 Developer, Data Dude team announced the immediate availability of the first public CTP of the Visual Studio Team System 2008 Database Edition GDR (General Distribution Release).

 

The GDR is available now for download but before you install it, make sure read the installation requirements. If you have DBPro Power Tools installed, uninstall it first. AND you'll need to have Visual Studio 2008 Service Pack 1 Beta installed

 

 

From Gert's post:

What is in the GDR?

In addition to enabling SQL Server 2008 database projects, the GDR release incorporates many of the previously released Power Tools functionality as well as several new features. The new features include explicit separation of Build and Deploy, separation of Database and Server project, improved project reference support, T-SQL Static Code Analysis and integration with SQL-CLR projects.

Architectural changes

  • No more DesignDB; one of the most important architectural changes is that the Database Edition no longer requires a local SQL Server instance to host the "Design Database" to open and validate a database project.
  • Single model, everything is now loaded in a single model representation. The model now represents all object types, which removes the need to have certain objects represented as Pre or Post Deployment scripts. This means that for example logins, rules, defaults, asymmetric keys, symmetric keys, certificates, etc. are now schema objects and therefore fully participate in schema comparison and build/deploy. Pre or Post Deployment scripts still exist, but are only used to perform none schema object related operations.
  • The model is no longer 100% memory resident, in today's version all model information has to reside in memory, this change dramatically lowers the memory consumption of the product.
  • Provider based, the underlying implementation of the project system and schema model are changed to be provider based. Providers are refer to as "Database Schema Providers" or DSP's for short. The GDR release will ship with 3 providers supporting SQL Server: 2000, 2005 and 2008. However if you watch the Tech*Ed keynote this morning, you saw that IBM is working on a provider to support DB2 and there are others that are working on providers for other database management systems.
    • Providers are not restricted to relational database systems, in the future we will be adding providers that support dimensional and hierarchal data stores.

Project System

  • Database & Server project separation
    • We separated out the existing database project in to two project flavors: database and server. The server project represent those schema objects that are server wide, for example logins, linked servers, server side DDL triggers etc. Database projects represent the objects inside the user database. The split enables a team to define a standard a configuration for their SQL servers and reference it from their Database Projects. The goals is to have a single point of definition and to be able to share this definition between projects and deployments.
      • The separation is implemented using a property inside the project file. There are effectively 3 modes: server, database and hybrid. The hybrid project represents the overloaded project model as it exists today where server and database objects are mixed inside a single project. This model is there to support existing project upgrades.
  • Partial projects
    • Allow code sharing between projects by including files from a different project, where the code is included "as-is" from the originating project and the source code control ownership remains with the originating project. This enables code reuse between projects and while resulting in a single deployment unit.
  • Composite projects
    • Composite projects, enables database projects and/or .dbschema files to contribute to another project. This enables the separation of development roles and responsibilities and composition of Databases using multiple projects. It extends the existing database reference implementation, by allowing to contribute in to the same database, where the existing database projects have to represent 3 or 4 part name references.
  • Single sourcing of external artifacts
    • You can now create a reference to a SQL-CLR (VB.NET or C#) project, or the binary output of a project and turn it in to a ASSEMBLY inside the project. This enables single sourcing of artifacts that are developed outside the context of the database project. For the final release we will also allow references to XSD files which will become XML Schema Collections inside the database schema.

SQL Server 2008 Support

  • The GDR adds a new project for supporting SQL Server 2008. The June CTP has support of the new SQL Server 2008 data types, both intrinsic (date, datetime2, datetimeoffset, time), build-in SQL-CLR types (geography, geometry, hierarchyid), support for the new DML MERGE syntax and support for table typed parameters. The remaining SQL Server 2008 syntax and functionality will be added in future CTP's.

Build & Deploy

  • One of the other main changes in the GDR is the separation of the build and deployment process. Build now produces a single portable artifact file, a .DBSCHEMA file. The DBSCHEMA file is an XML representation of your complete schema. The DBSCHEMA is then fed in to the redistributable deployment engine.
  • The deployment engine now uses the exact same database model as Schema Compare, which guarantees the same results between the two parts of the system.

Refactoring

  • The biggest change in refactoring is the addition of a patented implementation of a feature named "Preservation of Intent". This enables the deployment of refactoring changes as intended by the user. For users this means that renames are deployed as renames not as drop/add statements, move aschemas as move schemas etc.
  • Besides that we are adding new refactoring types that we previously in the Power Tools:
    • Wildcard Expansion
    • Move Schema
    • Fully Qualify
  • And we are enabling extensibility for refactoring which enables users to develop and deploy custom refactoring types and targets.
    • Types are the refactoring operations, where targets are the artifacts you want to apply the refactoring operation to. An example of a refactoring type is: table split or upper case all keywords. An example of a refactoring target is an Reporting Services RDL file, which contains references to database schema objects, which if you change thos, you want to update them as part of the refactoring operation.

Schema Compare

  • Schema Compare now uses the same underlying database model as build and deploy, guaranteeing fidelity between the results. This allows the user to compare any combination of Database Projects (.dbprj), live Databases or .DBSCHEMA files.  So comparing project to project, project with a DBSCHEMA file, or a DBSCHEMA file with a live database.
  • We added the ability to limited the schema comparison based on object types (Object Type Filtering) and we added additional Ignore filtering options.
  • We also enabled the substitution of SQLCMD variables, allowing correct comparison when using SQLCMD variables for references or in other parts of your code.

T-SQL Static Code Analysis

  • T-SQL Static Code Analysis, and the accompanying MSBuild task, are now part of the main product.
  • And we added the ability to develop and deploy your own custom T-SQL Static Code Analysis rules.

Dependency Viewer

  • The Power Tools to view the dependency relationship between objects inside your schema, is now part of the base product.

Database Unit Testing

  • Database unit testing now supports execution of tests using different ADO.NET providers and it also enables unit testing when using multiple database projects.

• Data Generation

  • We made some general design-time enhancements Data Generation like adding support for undo/redo and separation of the population status into new display window.
  • The Foreign key generator can now be replaced by custom generator.
  • And we made some runtime enhancements, by default the Data Generator now uses the SqlBulkCopy interface to populate target tables, which results in a general performance improvement during data load time.
  • We also introduced the concept of Data Sinks which allow the user to register different outputs, for example we can generate data to files instead of to a live database, so data can be loaded out-of-band using BCP or BULK INSERT. 
  • And last but not least we were able to significantly trim the size of the .DGEN file. 

Public extensibility:

  • The last piece we changed in the GDR is to expose more extensibility points in to the system. In the GDR we are not allowing new providers to be plugged in this will be available in the next release, but we do allow users to extend the system by writing their own:
    • Data Generators
    • (Statistical) Data Distributions
    • Test Conditions
    • T-SQL Static Code Analysis Rules
    • Refactoring Types
    • Refactoring Target
  • We also made the deployment engine a redistributable component, so you can deploy DBSCHEMA files programmatically.