Saturday 28 January 2012

SQL Server : Unicode / Non Unicode Data types

I write this topic to give you a quick tips when you're facing to some errors messages like 'cannot convert unicode to non unicode ....'
In SQL Server, unicode character is encoded in 2 bytes rather than 1 byte for a non unicode character.
In SQL Server, unicoded datas type are prefixed by 'n' : nvarchar, nchar, ntext (deprecated because will be remove in later version of sql server).
They are the same as varchar, nchar,text except that :
- they can handle up to 4000 characters  instead of 8000 characters for varchar,char,text.
- take more memory space
- can support a wider range of characters.

Sometimes in SSIS, the source is captured as a DT_STR ( non unicode ). A classic problem is that the table column is set to nvarchar ( unicode ) data type. A problem occurs when executing the task.
To resolve that issue, 2 solutions :
1- change the table column data type to varchar ( non unicode ) - it's working but I think that it's a dummy and dirty solution.
2- create a temporary output column of type DT_WSTR ( unicoded ), code some inputprocessrow business logic  and map the table column of type nvarchar to that temporary column.

Saturday 7 January 2012

Mango unlock - Please check that the Zune software is running and that Zune's sync partnership with your phone has been established - Resolved

Hi all windows phone users :
Today, I have to re-unlock my windows phone 7 with the new firmware Mango 7.5. I've noticed that the phone became locked after the Mango update.

During the unlocking process, I've this error message : 
Please check that the Zune software is running and that Zune's sync partnership with your phone has been established 

The guys from yallapps told me that I must uninstall and reinstall the Zune software. Once done, the same issue occurs and finally I decide to handle the problem myself.

First of all, it's impossible that this is due to Zune because i've the last version.

After seeing the behavior of message display in the unlock popup, the error fires after the message " connect to the phone ..." is displayed.
But Zune can connect to my phone, as proof, a sync was successfully done just after connecting the phone to my pc.

So, it seems that there's something blocking at the connection when the phone is sending data to outside.
At this time, I verify that any internet connection cant be made from the phone by using the usb .


Solution
I  switched the connection provider to use the mobile network 3G+ instead of using the usb connection and after redoing the registration process, the problem was solved.  My phone is now dev unlocked