Posts filed under ‘MS SQL Server’

DTS is ignoring my failure workflow

Recently, I  created a simple DTS that sends a email when a task failed. The email is an ActiveX program that reads the email config from an INI file and is linked to the other task via a failure workflow link. So when the task fails, the email task is activated. I then attempt to simulate a failure by RAISERROR. Much to my surprise, the entire task halted instead and the error task is never called.

In my case, the problem turns out to be a configuration issue. If you right-click on the DTS package and get “Package Properties”. Click on the Logging tab, uncheck the “Fail package on the first error”. If this option is checked, the entire DTS stops before the error task can run.

October 1, 2007 at 2:39 pm 1 comment

SQL Server 2005 Failed to install due to ASP Account not being setup

I attempted to install SQL Server 2005 server on XP MCE. I had previously installed all of the components including IIS, .Net framework, etc. In the middle of install, I got the following error:

SQL Server Setup failed to obtain system account information for the ASPNET account. To proceed, reinstall the .NET Framework, and then run SQL Server Setup again.

The problem is that the user ASPNET was not created at any of the previous installs. To create this user, I did the following (note that framework version may have a different version on your machine)

cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

aspnet_regiis -i

This creates the ASPNET account. After the account is created, SQL Server 2005 installed normally.

January 19, 2007 at 3:57 pm 27 comments

Soft hyphen broken my XML – a warning about encoding

Suppose you type “Pesto – a receipe” in Microsoft Word. it will automatically replace your dash with a soft hyphen. You can store that string with the soft hyphen in a database field in MS SQL. Suppose you write a program to extract that string from the database and return it as an XML and attempt to display it in the browser, the browser will complain that the XML contains an invalid character. If you use an XML parser, you’ll get an exception.

Dumping the XML file using hexdump (a open source program) reveal the problem. One expects the soft hyphen to be 0xAD, instead the soft hyphen shows up as 0x96. While 0x96 is a displayable character in ANSI (which is the default encoding in windows and MS SQL), it is not a displayable character in unicode. Since most XML are in UTF-8, the 0x96 blows up the viewers and parsers.

Be real careful about copy and pasting from Microsoft Word into the MS SQL database. Be sure what you are copying and pasting is a dash and not a soft hyphen.

August 31, 2006 at 3:36 am 3 comments

osql converted characters during execution

Suppose you have a sql script that inserts values into a MS SQL database. You had previous tested the script on the query analyzer, but when you ran the script in osql you notice that some of your characters have been converted. For example that soft hypen has mysteriously turned into a “û”.

Windows uses several different type of codepages. There is ANSI, which is used by windows and appears to be the default on SQL 2000 server. DOS uses OEM. There is also the Unicode format.

The problem is that when you run osql from the command line or from a cmd file, it automatically assumes that the file is in OEM format. If your file is in ANSI, it will convert the characters as if you are going from OEM to ANSI. This can cause some characters like a hypen to convert.

Solution is to save the file in Unicode. 

August 30, 2006 at 1:05 pm Leave a comment


Calendar

May 2017
M T W T F S S
« Jun    
1234567
891011121314
15161718192021
22232425262728
293031  

Posts by Month

Posts by Category