by Stephen Horsfield
4. September 2008 09:26
Since yesterday, and my post about Google Chrome, Google has updated its terms and conditions and removed the clauses. See my previous post here: Security: How much do you trust Google?.
Privacy clauses
Section 11 has been completed rewritten. Note that this is the only change in the terms of service, even the date has not been changed:
11. Content license from you
11.1 You retain copyright and any other rights you already hold in Content which you submit, post or display on or through, the Services.
Looks a bit different to the previous clause. Specifically, the following has be...
[More]
by Stephen Horsfield
3. September 2008 08:14
Google has just released a beta of its Google Chrome web browser. Make sure you read the terms and conditions. Have a look at the privacy clauses...
[Note: Google has updated its terms and conditions. Read my blog post here: Security: Google retracts its privacy clauses]
Privacy clauses
11. Content license from you
11.1 You retain copyright and any other rights you already hold in Content which you submit, post or display on or through, the Services. By submitting, posting or displaying the content you give Google a perpetual, irrevocable, worldwide, royalty-free, and non-exclusive li...
[More]
by Stephen Horsfield
21. May 2008 14:59
I'm currently reading "Enterprise Architecture as Strategy" by Jeanne W. Ross, et al., published by Harvard Business School Press. I recommend that you obtain a copy and read it if you are interested or involved in enterprise architecture or business IT strategy.
Read more online
You can find out more about the book and the ideas it contains here: http://architectureasstrategy.com/book/eas/.
Reference
Enterprise Architecture as Strategy
Creating a Foundation for Business Execution
Ross, Weill, Robertson, Harvard Business School Press, 2006
...
[More]
by Stephen Horsfield
21. April 2008 10:14
Overview
Recently, I began having problems with Virtual Server 2005 R2 on my Windows XP computer. I was not aware of anything having changed, except suddenly my VPCs couldn't find a network adapter. Facing the possibility of a complete laptop rebuild, I was scouring the net for a solution...
Failed attempts
Before finally landing a working solution, I attempted the following:
Restarting Virtual Machines (before and after other changes)
Restarting Virtual Server (and associated services)
Looking for patches (none applicable)
Creating new network configurations
...
[More]
by Stephen Horsfield
11. March 2008 12:36
Overview
Here's another product suggestion I've logged with Microsoft along the same lines as the previous one. This one is to allow you to dynamically specify the list of columns you want to unpivot. This might be from a stored procedure parameter or a subquery, either way you can't do it easily at the moment. Register your support here:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=332512
Detail
Current behaviour
UNPIVOT (value FOR column_name IN (Col1, Col2, Col3, Col4))
All columns must be known in advance and specified in full.
Suggested beh...
[More]
by Stephen Horsfield
11. March 2008 10:54
Overview
I've logged a suggestion with Microsoft for support for the inclusion of NULLs when you use the UNPIVOT operator. Add your support if you think this would be useful:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=332325
Example
Source data
ID
Col1
Col2
Col3
Col4
1
Value
NULL
Value
NULL
Current behaviour
UNPIVOT (value FOR column_name IN (Col1, Col2, Col3, Col4))
...
[More]
by Stephen Horsfield
10. March 2008 12:35
Overview
Auditing the actual changes made to a table can be quite complex, but is often required. In SQL Server 2008, you can use the new feature Change Data Capture, but in 2005 you have fewer options.
Here's an approach using common table expressions, table variables and a nice, big and hopefully fast query!
Context
click here to view this online and see the code formatted for viewing
Suppose you have a data table and an audit table as follows:
1: CREATE TABLE tblToAudit (
2: pkid int identity(1,1) primary key,
3: col0 nvarchar(20),
4: col1 nvarchar(20),...
[More]
by Stephen Horsfield
28. January 2008 09:00
Overview
I have configured a number of different Linux distributions on Virtual Server 2005, but SUSE Linux 10.3 was a non-starter...
The problem
Booting from a SUSE Linux 10.3 ISO (downloaded from http://www.opensuse.org) wouldn't get past the driver loading section. I tried all the usual options such as the brokenmodules option and the noacpi option, but to no avail.
The solution
In the end, I decided to try an earlier version, this time SUSE Linux 10.1 from Novell's website. This time it installed without problems. The VM additions 2.0 installed without a hitch, and once I'd reconfi...
[More]
by Stephen Horsfield
17. January 2008 09:02
Overview
Have you ever wondered how to view object permissions using a query?
Simple example
Try this on a database:
select o.name, u.name, p.permission_name, p.state, p.state_desc
from sys.database_permissions p
inner join sys.all_objects o
on p.major_id = o.object_id
inner join sys.database_principals u
on p.grantee_principal_id = u.principal_id
References
sys.database_permissions (Microsoft TechNet)
sys.database_principals (Microsoft TechNet)
sys.all_objects (Microsoft TechNet)
Versions
Microsoft SQL Server 2005...
[More]
by Stephen Horsfield
16. January 2008 16:29
Overview
Do you have problems searching for text in files using Windows XP, Windows Server 2003, Windows Vista or Windows Server 2008? This problem has been affecting us in our development environment, but how can you fix it?
Context
From Windows XP, Microsoft changed the default behaviour of the Windows Explorer search feature. They did this for performance reasons, and from Windows XP Service Pack 2 onwards you can choose to revert to the old behaviour, but the effect was that only certain file types are searched by default.
Solutions
There are two solutions:
Register a handler...
[More]
by Stephen Horsfield
15. January 2008 11:00
Overview
Do you have lots of tables that reference each other using ID fields? Are they of different types, such as nvarchar(10) and int? Do you sometimes find that it can be hard to remember how many characters should be in the type? And what about when you decide that you need a bigger type, such as nvarchar(30)? How can you ensure that your database design remains consistent?
Alias Data Types and the CREATE TYPE statement
An Alias Data Type is a type defined by you in SQL Server that refers to an internal data type. You can use it anywhere you would use a normal SQL type, except in ...
[More]
by Stephen Horsfield
14. January 2008 15:25
Overview
I'm in the process of reviewing a large number of SQL stored procedures, and occasionally I find that a table join isn't properly expressed. This can result in hard to find bugs, but how can you make your SQL code simpler? Isn't using a stored procedure best-practice anyway?
Scenario
It is quite common to have a series of related tables. Consider a stock control system. Perhaps you have tables for customers, orders, order lines and stock items. In this simple scenario, you have four tables and clearly there are joins between several of the tables.
Common solution
A common so...
[More]
by Stephen Horsfield
11. January 2008 17:39
Overview
I've just found this by chance while in the process of reviewing around 100 stored procedures to check for performance efficiency. It doesn't help with badly written queries, but if the query is reasonable then it can help you find those elusive missing indices. Thought I'd have to find them myself, but thankfully help is at hand...
Details
Normally, you would use the SQL Server Profiler to help track performance issues, but what if you are not in a live environment? SQL Server 2005 helpfully collects some data that you can use.
Warning: the data is only kept for while the ser...
[More]
by Stephen Horsfield
11. January 2008 15:31
Overview
You may know that it is best practice to create FOREIGN KEY constraints on related tables in a database. Why is this?
Details
A foreign key constraint can be used for:
Ensuring referential integrity: a foreign key constraint can ensure database consistency
Self-documenting databases: the foreign key clause can be viewed in the database and describes a relationship
Efficiency: even without an index, the SQL Server engine recognises the constraint and uses it to optimise table joins automatically
Generally, you will also want to index the foreign key columns i...
[More]
by Stephen Horsfield
9. January 2008 15:16
Overview
Following on from my previous post, here's a quick way to find out which data tables are using the most disk space...
References
Table and Index Organization (Microsoft SQL Server 2005 Books Online (September 2007))
Solution
SELECT o.name AS table_name, SUM(au.data_pages) as pages,
((SUM(au.data_pages) * 8192) / (1024 * 1024)) AS MB
FROM sys.allocation_units AS au
JOIN sys.partitions AS p ON au.container_id = p.partition_id
JOIN sys.tables AS o ON p.object_id = o.object_id
JOIN sys.indexes AS i ON p.index_id = i.index_id AND i.object_id = ...
[More]
by Stephen Horsfield
9. January 2008 12:01
Overview
I'm in the process of reviewing a database for performance analysis. One of the most important tasks to perform is reviewing of statistics. Because this database is currently live, I cannot get the locks to use the sys.dm_db_index_physical_stats built-in function. I have an Oracle background and didn't know how to get the row count quickly. Here's my solution...
References
http://www.mssqlcity.com/Articles/KnowHow/RowCount.htm
Solution
I use the following code to get the total number of rows for all tables in the current database:
SELECT sysobjects.[name], max(sysin...
[More]
by Stephen Horsfield
8. January 2008 17:11
Overview
Sometimes you have to manually refresh folders in Windows XP to see changes that have taken place on network servers.
Context
When you create or delete any file in one or more network folders, you have to refresh the display to see the changes. This can happen with any folder, but most frequently when you are using Microsoft DFS technology.
Solution
You need to follow the instructions in File list in the Windows Explorer folder is not refreshed after you create, move, or delete files (Microsoft Support). This requires two things:
Install Windows XP Service Pack 2
M...
[More]
by Stephen Horsfield
8. January 2008 15:10
Overview
Sometimes, old code doesn't seem to work with the new Data Execution Prevention feature in Microsoft Windows. It's easy to turn it off for non-system applications and services, but how do you do it for system components, and why would you?
Warning: Data Execution Prevention is a security feature. Disabling DEP reduces the security of your system.
Context
On our Microsoft Commerce Server 2002 system, running on Windows Server 2003, we were getting "COM Surrogate" errors, which relate to DEP errors with the dllhost.exe system program. Adding it to the exception list didn't solve ...
[More]
by Stephen Horsfield
8. January 2008 12:44
Read the article...
Excerpt
The above error was occurring on both staging and live environments for a Microsoft Commerce Server 2002 system. It took us a while to track down the cause, but eventually I fixed it.
References
Microsoft KB Article 811306
Versions
Microsoft Windows Server 2003
Microsoft Commerce Server 2002
Metadata
Technorati Tags: IT Management, Windows, Windows 2003, problem, Commerce Server
by Stephen Horsfield
6. January 2008 10:53
Overview
The time service is a critical part of any Windows Active Directory infrastructure. Why? Because it is part of how Active Directory replicates correctly, because it supports the implementation of Kerberos and because all your networked computers will be synchronised using it, even if you don't configure it.
Quite often, a seemingly unrelated error message will be caused by time service configuration errors. I've written small guidance notes quite often to help administrators sort out these problems, but I wanted to collect my knowledge into a single blog post so that it is availa...
[More]