Monday, September 26, 2011

Preparing “Data Dictionary” using SQL Query

Data dictionary is the required while documenting any project. So here is the query for preparing the data dictionary of any database.

SELECT [Table Name] = OBJECT_NAME(c.object_id)
,[Column Name] = c.name
,[Data Type] = t.name
,[Size] = c.max_length
,[Description] = isnull(ex.value,'') 
FROM sys.columns c 
LEFT OUTER JOIN sys.extended_properties ex ON (ex.major_id = c.object_id AND ex.minor_id = c.column_id AND ex.name = 'MS_Description') 
INNER JOIN sys.types t ON c.system_type_id = t.system_type_id 
WHERE OBJECTPROPERTY(c.object_id, 'IsMsShipped')=0 
AND OBJECT_NAME(c.object_id) in (select name from sys.tables where type= 'U') 
ORDER BY OBJECT_NAME(c.object_id), c.column_id

Just include the column of the table definition (if any other required - i.e. if you want to display whether the column is null/not null, just include the field from sys.objects table and so on).


Learn by diving in Programming Ocean...
Happy Programming!!!

Friday, September 23, 2011

Taking backup of Skype contacts

Something important thing to share with you.

If ever you are using Skype messenger, please make a habit to take backup of contacts on timely basis, because your contacts gets deleted you can easily restore/recover them back from backup file.

As today only I lost all my contacts from skype messenger, because I used old version of skype messenger and Skype suggest us not to use old version when new version is out.

So then after contacting to skype customer care, they restored my contacts.

So to overcome this situation keep a habit of taking backup of skype contacts if you are using skype for communication purpose

Learn by diving in Programming Ocean...
Happy Programming!!!

Tuesday, September 20, 2011

Serializing into JSON using .Net 4.0 classes

Lets discuss something new and interesting points related to latest technology JSON.

While returning data in ajax call of jQuery we generally convert into string and then IIS serialize the data.

But .Net 4.0 provides the DataContractJSONSerializer class which automatically converts any datatype to string datatype (i.e. generic list/any type of data can be serialized using this class and returned back in form JSON).

Learn by diving in Programming Ocean...
Happy Programming!!!

Parsing JSON using jQuery

Lets discuss something new and interesting points related to latest technology jQuery & JSON.

Many of us might have worked in it and others don't need to worry as in future they will surely work in it.

Recently I came across one thing that "While using JSON we require parse_json.js file (plugin), but according to me this file is not at all required. As parse json function is already included in default jQuery pre-requisite file (.js) only. "

To refer the complete syntax visit: http://api.jquery.com/jQuery.parseJSON/

Learn by diving in Programming Ocean...
Happy Programming!!!