William Duffy

Glasgow Based ASP.NET Web Developer

Post archive for ‘SQL Server’

Order by day column using SQL

If you’ve ever had to sort a SQL query’s resultset using an “order by” clause on a “day of the week” column then you will know it can be very easy, or very tricky, depending on the format that the day is stored in the database.
If you stored the day of the week in numerical [...]

JSON serialization in ASP.NET

When working with JavaScript and ASP.NET together you will no doubt find yourself having to return objects from the server side domain to the client side domain.
One common method of doing this is to return XML which represents the object you wish to return. You then map the values in the XML document to [...]

Sql Server 2008 - Saving changes is not permitted

After installing Sql Server 2008 one of my developers was having a hard time trying to save updates to any of our database tables. Every time he tried to save a table alteration he was presented with the error.

Saving changes is not permitted. The changes you have made require the following tables to be dropped [...]

Monitoring Database Connections

If you don’t close your database connections you can take down your server in a few minutes, that’s fact! But closing database connections is something that beginners can very easily forget. Here I will show you how to monitor database connections to SQL Server and ensure that your code is not draining the connection pool [...]