Showing posts from November, 2010

Deleting an Email Account on the Windows Phone 7

I don’t think that it is completely obvious how to delete an email account on the Windows Phone 7, so I am writing this quick blog post to describe how to do it. Click on the Windows button to get to the start screen (with the tiles) Swipe right to get to the applications list Swipe down until you find the settings icon. Tap on Settings to enter settings. Choose email & accounts Find the email account that you want to delete. Press down on the email account you want to delete until the secondary menu appears. There will be an option to delete , tap it. {6230289B-5BEE-409e-932A-2F01FA407A92}

A Smart Overloading of a Stored Procedure Call by Mining COALesce.

Often you have a table where different columns needs to be updated by different calls.  Traditionally, you wrote a stored procedure for every variation which can result in a mountain of code (increases your LOC/hr but drives maintenance cost up more!)   IF you can eliminate NULL as being a valid value (use ‘’ instead?) then you can reduce everything to a single stored procedure as illustrated below.   Create proc harvest.P_UpsertEvent @ID uniqueidentifier = null , @ParentID uniqueidentifier = null , @ConsolidationSequenceNo bigint = null , @Level smallint = null , @EventFulId varchar ( 50 ) = null , @VenueID uniqueidentifier = null , @Title nvarchar ( 120 ) = null , @Text nvarchar ( max ) = null , @Html nvarchar ( max ) = null , @StartAt datetime = null , @EndAt datetime = null , @ExtendedXml xml = null AS If Exists (

Sql Upgrade Strategies

In my prior post I described how you can identify the different between a prior production database and a developer’s evolution of the database. You could make the developer responsible for developing the scripts but that is not always the best use of such a resource (do you make the developer responsible for writing all of the automated unit tests for their code and thus do not need testing resources? The appropriate best use of a developer issue is similar). Whether the developer’s does it, the database developer does it or a contracted resource does it – you end up with a batch of TSQL for each ‘upgrade’ (there may be dozens of developer’s upgrades in a product release cycle). This post looks at the management issue.   We have the TSQL to go from Prod –> Dev We want to apply it to some other Prod system   The basic pattern is a series of update files and a console application that reads the TSQL in , configuration information and then apply the information. The fi

Startups and Sql Server Databases

Often a startup tosses out a database to get a web site up or product out of the door. This is reasonable when there is neither the time(-to-market) nor the money (for SQL Data Modelers and developers).   For a web site there is usually one of two patterns of evolution: Use the production database for development. There’s no problem of matching database to next generation code base. Side-effects can be horrible from miscoding or security breaches. Use a clone of the production database and then evolve it with the next generation code. For a product database, 2. above is the typical option. We will consider this type of option alone in this post. The second pattern we need to look at is a non-issue for a one-man development shop, but arises with there are multiple developers: A single shared development database Any problems impacts the entire development team Each developer has their own development database Each developer

Finding out what changed between two versions of a SQL Server Database

This is just a quick note showing how you can compare the structure of two databases  easily. These queries will spell out what (and their types) -- One way Select name,type from MyDataBase_dev.sys.objects EXCEPT Select name,type from MyDataBase.sys.objects -- reverse direction Select name,type from MyDataBase.sys.objects EXCEPT Select name,type from MyDataBase_dev.sys.objects The next item to check is usually columns, which follows a similar pattern:   Select Table_Name,Column_name from MyDataBase.Information_Schema.Columns EXCEPT Select Table_Name,Column_name from MyDataBase_Dev.Information_Schema.Columns Select Table_Name,Column_name from MyDataBase_Dev.Information_Schema.Columns EXCEPT Select Table_Name,Column_name from MyDataBase.Information_Schema.Columns Many developers do not know about the very useful EXCEPT operator which excludes from one SELECT all matches in another SELECT. You can do this for the rest of the system catalogs (ju

Writing Web Pages for a Client That You Can’t Test

Every time I get a C# exception on my ASP.NET web site running in Windows Azure, I have my web site code send me an email; this email includes the call stack, path information, and user agent string. I can use these email to find the problems with the code that caused the error. For a long time I have been ignoring the email (about 50 a day) and letting them stack up – being too busy with other projects. Lately, I have resolved to clean up all the code, so that I get less email and reduce the bugs in the web site. I thought this would lead to a better user experience for people visiting the site.   My typical process is to read the call stack, look at the path information and try to reproduce the issue to gain insight into how I have to fix it. Basically, a debugging process that I have in my toolkit no matter what the environment I am programming. To get started I make sure that I am running the same browser that the user was using, be that Firefox, Internet Explorer or Google C

The sales pitch to developers …

Last night I attended the local Linux Group meeting with a presentation on  a MS Access/OO.Base to Drupal presentation described as:   “Most people think of drupal as a website framework system. However, it can also serve effectively as a replacement to the forms/reports/tables system utilized by access and base. (as well as many other things, but we won't discuss that formally tonight) No prior knowledge of Drupal is required, and for those who do understand drupal, we will go through using cck and views, as well as a few other modules to develop a replacement for a small access database.” Since this is a Windows Blog, it appears to be off target – however since it’s a emotionally-detached example to illustrate what is also seen with Windows stuff. As a FYI, I grew up on CP/M and ran Mark Williams Unix ( Coherent ) in the mid 1980’s, we have three Linux boxes in the house.   The first  thing that I struck me during the talk was that the speaker was laying smoke (as

Who should be in a startup team?

Often people approach a startup with a naive attitude that they can succeed by just doing what they want to do. The reality is that there are many roles that need to occur to have a reasonable chance for success. In this post, I will summarize a lean team and the roles that they may need to implement. Idea person – who should function as Domain Expert Tester – does the product match their vision? Handling Sales Calls  (because they speak the client language – hopefully) Product Manager – the decision maker for the development team Researcher Business case writer Specification writer Project planner Documentation writer Tester Code reviewer Liaison Handling Sales calls Developer Team A pair of developers Team Programming' Redundancy if one leaves ----------------------------------

So you want to do a startup – the “F” projects

“F” is for friendly. This type of startup addresses the frequent problem of insufficient domain knowledge (outside of coding and possible “day job”). “Day Job” domain knowledge often run risks of conflict of interest, or if your employment contract is hard-nose, the startup could become claimed (with no remuneration) by your day job employer.   The basis of the “F” project is to be friendly to the local business community. Via local business groups (for example TAG in Whatcom county), you indicate you (or you as a part of a group) are willing to do pro-bono work for smaller business in the area. This is a fine line, the work should not be doing for free what they would likely pay someone to do (like create a web site) – that is bad karma. What you want to do is something that fills a gap.   I will give an example from my experience, when I meet my wife she was production manager for a firm that reproduce by hand figurines, C.Alan Johnson .  There was a dozen employees – all sk