But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

The community - a route to free training

I presented last night at the West Yorkshire BCS and received a number of comments that it was great to see free training being available. This for me is one of the most important areas of our community, and an area we are very lucky with. There are plenty of opportunities to access knowledge…..

Of late we have seen that the big vendor conferences (such as Microsoft’s TechEd, PDC and MIX) and the platform independent developer conferences (such as NDC) streaming their sessions live for free and also have their sessions available for free download within a few days. Microsoft’ Channel 9 is also an excellent resource of conference sessions and specially made material on a vast range of subjects from language design to scheduling of the buses on Microsoft campus. Or if you prefer to listen to something whist your drive why not try the .Net Rocks podcast. There are plenty more specialist resources out there on the web.

At the national level in the UK we also have vendor events such as Microsoft UK Techdays, and company run events like my company’s Black Marbles free events.

Outside company structures we have community events like DDD (general .NET interest) and SQLBits (SQL specific). These are free community run conferences where the members of the community submit session ideas, these are voted for by the community and a free Saturday conference is run using usually the  20 most popular sessions. Again, increasing some of these sessions are videoed and made available on the web.

At the even more local level there are always usergroup. In Leeds we have the BCS, Agile Yorkshire, Leeds SQL Usergroup, GeekUp and more I am sure I have not heard of. This pattern is reflected across the OK, it is just a matter of searching to see what is near you.

So there is no excuse for not trying to keep up to date, whether you want to learn via the web or in person. Why not have a look?

Recording of my SQLBits Session on Visual Studio 2008

A webcast recording of SQLBits IV session ‘Making the SQL developer one of the family with Visual Studio Team System’ is now available on the SQLBits site. This discusses the features of the VS2008 Database GDR Edition.

Unfortunately I will not be proposing a session for this years SQLBits community event on the 21st of November 2009 at Celtic Manor in Newport, as I will be travelling back from the Microsoft PDC in LA

SQLBitsLogo

Visual Studio 2008 Database Edition GDR release - Createdeployment

Whilst preparing for my session at SQLBits next weekend I was re-watched Gert Drapers' PDC session (TL45) where he used a command tool to deploy a database via a USB pen drive (about 30 minutes into the session). Now it seems that the createdeployment command line tool he used is not currently available outside Microsoft, but the same effect can be achieved use the VSDBCMD command.

Step 1 - get the files onto the distribution device

The first step is to build the distribution media, this is just an XCOPY process. As the MSDN documentation says you need to end up with the following directory structure on your USB drive; for this example I used G: for USB drive letter and Database1 for the name of the database I want to distribute

G:\ copy the contents of [Program Files]\Microsoft Visual Studio 9.0\VSTSDB\Deploy & sub directories
G:\ copy the dlls from[Program Files]\Microsoft SQL Server Compact Edition\v3.5 folder
G:\Database1\ copy the contents of [ProjectsFolder]\DataBase1Solution\Database1\sql\debug or release directory after the DB project is built

Step 2 - A script to do the deploy

It is now a simple process of running the command line tool, but this is a bit long to type each time so I used a batch file. My command usage was

deploy [DB name] [SQL server instance]
e.g. deploy database1 .\sqlexpress

The contents of the actual deploy.bat batch file is as follows. Note there are many more options you can set but this seems to be the basic minimum

VSDBCMD /a:Deploy  /dsp:Sql /cs:"Server=%2;Database=%1;Trusted_Connection=yes;"  /model:%1\%1.dbschema  /manifest:%1\%1.deploymanifest /script:%1%.sql /dd

Using this batch file a new instance of a database can be created or an existing one updated.

Note: When I first tried to get this going I keep getting SQL file create errors which appears as TSD01268 errors in the deployment log. Eventually I realised the problem. I was running on a 64Bit Windows 7 PC. My default SQLExpress instance, running as the Network Service account, was setup to and had rights to create files in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data but not in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. Unfortunately the VSDBCMD tried to use the second location. Once the SQL instance was set to default to the second location and suitable rights provided all worked correctly.